2 ms·
The input was valid. It just wasn't clean. It had empty tags, bold tags that wrapped a line break and ended at the beginning of the second line, and other oddit
by nicbou 4y ago
The input was valid. It just wasn't clean. It had empty tags, bold tags that wrapped a line break and ended at the beginning of the second line, and other oddities that don't quite translate to markdown. There were also site-specific conventions that I replaced (basically, how I handle footnotes).
The nice part is that I could fix those issues with regex. I could fix hundreds of page in a few keystrokes, and only commit changes if they looked right. I also fixed thousands of little things that were impossible to fix before, because editing text files is trivial.
To migrate the content, I converted the templates to output plain markdown files instead of HTML. I also had one page that was a plain text list of all entries to migrate. A script read the list and saved each rendered markdown file.
I can't overstate how pleasant it is to work with plain text files. Today, I'm reviewing 450 locations with the Google Places API. I fixed a dozen businesses that moved or closed. This would have taken days before. It was to tedious to even try.