1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-15 06:14:53 +00:00
TiddlyWiki5/plugins/tiddlywiki/markdown
RJ Skerry-Ryan 13faeaa0bd
Markdown: Let WikiText parsing handle the creation of LaTeX widgets. (#6428)
* Markdown: Let WikiText parsing handle the creation of LaTeX widgets.

When embedding LaTeX snippets in inline HTML nodes, such as TiddlyRemember
macros or HTML tables, the parsing of latex nodes breaks the WikiText by
splitting it into pieces around the latex node.

This commit fixes the issue by converting the Remarkable katex nodes back to
text, using a newline to indicate a block katex snippet. This is then re-parsed
by the WikiText KaTeX plugin.

TESTED:

Created a test wiki with:
```
$ node tiddlywiki.js test --init markdowndemo
$ node tiddlywiki.js test --listen
```

* Verified markdown + KaTeX support still works as expected.
* Verified that embedding LaTeX snippets in inline HTML works (e.g. `<a
href="https://example.com/">$x^2$</a>`).
* Verified the markdown + KaTeX support works as expected with renderWikiText
set to `false`.

* Style: Remove spaces between if and opening parentheses.
2022-01-30 11:23:00 +00:00
..
EditorToolbar Update codemirror and markdown plugins from #2315 2016-04-22 08:41:31 +01:00
files Add optional KaTeX support to markdown plugin (#5846) 2021-07-06 11:32:32 +01:00
images Update codemirror and markdown plugins from #2315 2016-04-22 08:41:31 +01:00
config_breaks.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
config_linkify.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
config_linkNewWindow.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
config_quotes.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
config_renderWikiText.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
config_renderWikiTextPragma.tid Markdown: Let WikiText parsing handle the creation of LaTeX widgets. (#6428) 2022-01-30 11:23:00 +00:00
config_typographer.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
docs_type_markdown.tid Update codemirror and markdown plugins from #2315 2016-04-22 08:41:31 +01:00
new-markdown.tid Use match operator instead of prefix 2020-01-05 13:54:06 +00:00
plugin.info Add optional KaTeX support to markdown plugin (#5846) 2021-07-06 11:32:32 +01:00
readme.tid Add optional KaTeX support to markdown plugin (#5846) 2021-07-06 11:32:32 +01:00
usage.tid Replace Markdown parsing library with Remarkable (#3876) 2020-01-20 13:13:36 +00:00
wrapper.js Markdown: Let WikiText parsing handle the creation of LaTeX widgets. (#6428) 2022-01-30 11:23:00 +00:00

title: $:/plugins/tiddlywiki/markdown/readme

This is a TiddlyWiki plugin for parsing Markdown text, using the [[Remarkable|https://github.com/jonschlinkert/remarkable]] library. If the KaTeX TiddlyWiki plugin is installed, KaTeX support is enabled using the [[remarkable-katex|https://github.com/bradhowes/remarkable-katex]] Remarkable plugin.

It is completely self-contained, and doesn't need an Internet connection in order to work. It works both in the browser and under Node.js.

[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/markdown]]