I have modified the official Markdown plugin of TiddlyWiki5 to use markdown-it as Markdown parser, use MathML for (La)TeX equations (using TeXZilla converter). This is an unofficial plugin, although I think it follows the general policy of TiddlyWiki.
As this plugin is in an EXPERIMENTAL stage, it may have some (lots of) bugs. If you are brave enough to give it a try, don't hesitate reporting bugs and raising issues on the project page on GitHub or GitLab.
The official TiddlyWiki5 Markdown plugin uses markdown-js, which gets the tiddler text and outputs what it seem to be a JsonML tree, which is then used by TiddlyWiki.
However, for my purposes I had the following issues with markdown-js:
- Currently it does not support inline html (issue)
- Lack of support for CommonMark dialect (issue).
The first issue is particularly important for me, as I would like to include MathML code together with Markdown.
This plugin breaks the parsing process into steps,
text → Escape tags → Math parsing → Markdown parsing → Preview,
and Markdown parsing is done by the following steps:
- Parse markdown code into an HTML string,
- Turn HTML string into a Json-like array,
- Pass resulting array to TiddlyWiki to be rendered.
With this parsing process it is possible to use any parser which outputs an HTML string.
In particular, markdown-it parser solved my issues with markdown-js, it has additional extensions to Markdown, and it seems to have a more configurable syntax extension, as you can add new rules and replace existing ones.
Not all browsers have support for MathML. As far as I know, Firefox has the most complete native support.
In those cases, it is still possible using this plugin by installing MathJax plugin for TiddlyWiki5, so that MathML rendering will be done by MathJax, and not the browser. I tested this approach on Firefox, Chrome and Opera, and it worked quite well.
In order to create wiki links, you can use the usual Markdown link syntax targeting #
and the target tiddler title:
[link text](#TiddlerTitle)
The math delimiters implemented so far are $...$
for inline equations, and \begin{equation}...\end{equation}
and \[...\]
for displayed equations.