This is the first post for Decoded Node that has been written with league/commonmark instead of erusev/parsedown. This technically aligns the Markdown implementation between this blog and my personal website (where CommonMark was readily integrated with Twig.) Which is fancy talk for:
- Footnote-style link syntax works on both sites now
- Smart quotes are automated, instead of using platform-dependent input methods, or UniCycle
UniCycle “works,” but it’s not maintained (AFAICS), and the implementation strikes me as a bit of a hack. It
works fine in insert mode, but r' won’t replace with smart quote. It’s a shame, because it has such a great
name.
(Also along the way, I decided that .md won, so this processor no longer accepts anything like .mkd or
.mdown. Makes things easier than asking, “does this file match /\.ma?r?k?do?w?n$/?”)
Didn’t the Title Mention… Authority?
What strikes me about this is that “the format which I author in” is only incompletely described as
“Markdown." This particular move was feasible because league/commonmark is effectively a superset of
erusev/parsedown. If I decided I wanted to go back, I would have to edit all the new features out of newer
posts. Actually, if I want to update an old post and I happened to miss a smart quote in it, the non-smart
quotes would also be changed by using the new parser.
What actually defines the output is not only the input, but the exact tool used to create it.
(I’m thrashing around in the direction of “the purpose of a system is what it does” and Hyrum’s Law, but neither of those things fit.)
That wouldn’t be much of an observation if I were saying, “An XLST processor doesn’t turn my Markdown into HTML,” but I didn’t really expect the choice of Markdown tool to matter so much to processing Markdown input.
Maybe it could be phrased as, “Markdown processors are not bug-for-bug compatible.”
Version Note
I use this code to write posts, not to mess around with code, so it’s not always clear whether the Markdown parser is up-to-date. However, it seems I was using Parsedown 1.7.4 which is, at the time of writing this post, the latest stable release. 1.8.0 is in beta, and 2.0.0 seems to be barely started.
No comments:
Post a Comment