TiddlyWiki5/plugins/tiddlywiki/markdown
2023-03-05 10:34:41 +00:00
..
editor-operations
EditorToolbar
files
images
KeyboardShortcuts
config.multids Markdown Plugin: Default to recognising TiddlyWiki-format links 2023-02-24 09:51:45 +00:00
config.tid
docs_type_markdown.tid
markdown-it-katex.js
markdown-it-tiddlywiki.js Markdown Plugin: Handle non-string attr values in tw_image() (#7284) 2023-02-24 15:41:29 +00:00
new-markdown.tid
plugin.info
readme.tid
styles.tid
syntax.tid
wrapper.js Add wikiparser.js dependency (#7330) 2023-03-05 10:34:41 +00:00

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

This plugin provides Markdown support via the [[markdown-it|https://github.com/markdown-it/markdown-it]] parser and its associated plugins:

* markdown-it-deflist
* markdown-it-footnote
* markdown-it-ins
* markdown-it-mark
* markdown-it-sub
* markdown-it-sup

!! Compatibility Notes

* <p>A tab character in Markdown has a size of four spaces. Configure the tab size of your code editor accordingly. For example, if you use <$text text="CodeMirror"/>, it is recommended that you set $:/config/codemirror/indentUnit and $:/config/codemirror/tabSize to `4` to avoid inconsistent indentations.</p>
* <p>HTML blocks are ultimately parsed by the <$text text=WikiText/> parser: //an opening tag followed by a blank line will activate block-level parsing for its content//. When working with tags designed to contain literal content, such as `<pre>` and `<style>` tags, refrain from adding blank lines after the opening tags.</p>
* <p>You must terminate a table with either a blank line or another block-level structure.</p>
* <p>`latex-parser` in $:/config/markdown/renderWikiTextPragma is no longer required and will be ignored.</p>
* <p>Config option `linkNewWindow` is removed.</p>

!! Extending the Parser

You can extend the parser by loading additional markdown-it plugins this way:

```js
var plugin1 = require(...);
var plugin2 = require(...);

var md = $tw.Wiki.parsers["text/markdown"].prototype.md;

md.use(plugin1)
  .use(plugin2, opts, ...);
```