dreamwidth icon indicating copy to clipboard operation
dreamwidth copied to clipboard

look into Markdown module options

Open rahaeli opened this issue 1 year ago • 4 comments

Had a bug report (via suggestions) that our current Markdown module doesn't support the full range of Markdown: the things they called out as missing were specifically:

  • double-tildes as strikethrough
  • double-equal signs (==) as highlighting
  • subheadings
  • codeblocks
  • subscript
  • superscript
  • footnotes

It looks like we're using Text::Markdown, which was last updated 2010. If someone has energy, we should look to see if there's a more current module that handles a full range of Markdown. (I know there is controversy over what Markdown features are Actually Markdown because there's no real standard and I do not want to wind up maintaining our own custom version like every other site out there does, but there might be a better option.)

rahaeli avatar Sep 05 '24 22:09 rahaeli

there's no real standard

I think commonmark is what everyone goes for compatibility with these days. all the major git forges, at least, use it as a base for their syntax

winrg avatar Sep 05 '24 23:09 winrg

Looks like that's implemented as https://metacpan.org/dist/Markdown-Perl . Tagging in @nfagerlund to see if we'd have to version anything like we had to do before?

rahaeli avatar Sep 06 '24 01:09 rahaeli

Definitely worthy of a version bump! 👍🏼 Thanks for remembering to check that.

The theory is that your old posts should never get retroactively mangled (even a little bit) when we add a new feature for new posts. Markdown compatibility is diabolically subtle even with libraries that are trying to speak the same dialect (and Commonmark is a deliberate break), so I'm about 100% sure we couldn't swap out renderers without mangling old posts. Ergo, bump it. 🔈

I think it goes a lil like this:

  • Keep Text::Markdown (or something bug-for-bug compatible) as a dependency, so we can keep using it on old content that expects it.
  • Add a new markdown1 format in Formats.pm and follow whatever html_casual0 and html_casual1 are doing. (Oh hey, looks like I left explanatory comments, nice.)
  • Add a new format opts item for telling markdown 0 and 1 apart, and branch on it in the body of clean() to decide which renderer to invoke.

nfagerlund avatar Sep 06 '24 06:09 nfagerlund

w00t, thanks for the implementation notes!

rahaeli avatar Sep 06 '24 17:09 rahaeli