Transform markdown to tiddlywiki5 wikitext syntax. Using unifiedjs.
-
to*
1.
to#
#
to!
Website demo: https://tiddly-gittly.github.io/md-to-tid/
Get md data from your wiki and transform it:
import { md2tid } from 'md-to-tid';
const prevMDText = $tw.wiki.getTiddlerText(title);
const tidText = md2tid(prevMDText);
$tw.wiki.setText(title, 'text', undefined, tidText);
$tw.wiki.setText(title, 'type', undefined, 'text/vnd.tiddlywiki');
Or if you have a MDAST: See Our test case for details.