Pandoc compatibility with Zettlr formatting #5268
Unanswered
Liam-Twomey
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
OK, so as a result of some issues I was having with table rendering, I went on a deep dive on how Zettlr parses Markdown. After a lot of experimentation with different flavors of Markdown which Pandoc supports (pandoc markdown, commonmark, commonmark extensions, github-flavored markdown, multimarkdown, PHP Markdown Extra and unextended original markdown), I found the Zettlr documentation about it. In short, it uses GitHub flavored markdown (gfm) to render in the viewer, and Pandoc to export. I've seen Nathan comment elsewhere that there's a long-term goal of using pandoc to render the zettlr viewer as well for consistency.
As I understand it, that means that the Zettlr viewer supports basic markdown, plus:
Pandoc just can't handle some of these natively, like mermaid.js. Overall, it seems like Zettlr uses However, I noticed when experimenting that Pandoc's gfm actually doesn't render that great in Zettlr;
commonmark-x
is much better, especially for tables. The gfm spec seems pretty clear-cut, so I'm wondering where the difference comes from. Based on this comparison table, it seems like pandoc also implements some extra features not included in gfm (although we see some of them via extensions).My understanding of the process is that there are three layers of markdown processing in Zettlr: the renderer is using github-flavored markdown with extension, linter (which as far as I can tell is
Zettlr/source/common/modules/markdown-editor/linters/md-lint.ts
, linked here) uses a subset of the re:mark linter, which implements commonmark, a subset of gfm. Finally, exporters use pandoc, if available. I've seen @nathanlesage talk elsewhere about switching to a pandoc-only model being a goal in the very long term, which would obviously be a huge investment of time and effort, as I don't see any pandoc linters out there, much less ones in JS. I guess my question is extactly what would have to be done to have a pandoc-syntax linter and formatter?Beta Was this translation helpful? Give feedback.
All reactions