Oh, one more thing for tonight. @TeXfan I've been following https://discuss.flarum.org/d/22439-mathren-tex-math-rendering/77, and I realize that LaTeX + WYSIWYG could cause issues, especially if any escaping creeps in. For that reason, I've added in 2 types of blocks:
- Inline, triggered by $, then some text, then another $.
- Block, triggered by $$ and a space
These inputs do nothing other than not escape their contents (and wrap them in the relevant delimiters when serialized to markdown), and not apply any input rules (no automatically turning stuff bold in the editor). However, I haven't implemented any LaTeX rendering, and TextFormatter will still do stuff in these blocks (so stuff WILL be bold in the formatted post). However that's all editor independent, and I assume that's taken care of in your extension.
I've done this here instead of PRing the extension because unlike the other cases (task lists and tables), if someone were to write some LaTeX in one of these blocks, disable the extension, edit the post, and save, a bunch of very, very annoying escaping would be added, and I really wouldn't want that.
Theoretically speaking, one interesting addition to the editor that COULD be good in an extension is a bubble / popup above a LaTeX input showing formatted/rendered contents. Shouldn't be THAT difficult if the ProseMirror node view API is used.