(zettel (meta (back "00001007000000 00001007040324 00001008000000 00001012920522") (backward "00001007000000 00001007040324 00001008000000 00001012920522") (box-number "1") (created "20210126175322") (forward "00000000090001 00001008010500 00001008010800 00001012920500 00001012920510") (modified "20260630174914") (published "20260630174914") (role "manual") (syntax "zmk") (tags "#manual #markdown #zettelstore") (title "Use Markdown within Zettelstore")) (rights 4) (encoding "") (content "If you prefer Markdown as your markup language, you can configure Zettelstore accordingly.\nZettelstore supports the [[CommonMark|00001008010500]] dialect of Markdown, as well as an extended dialect, [[Extended CommonMark|00001008010800]].\n\nThe [[''syntax''|00001006020000#syntax]] metadata of a zettel determines which Markdown dialect is used:\n\n; \"\"commonmark\"\", \"\"cmark\"\"\n: Uses the [[CommonMark|00001008010500]] dialect.\n; \"\"emark\"\"\n: Uses the [[Extended CommonMark|00001008010800]] dialect.\n; \"\"markdown\"\", \"\"md\"\"\n: The value of the [[''markdown-dialect''|00001004020000#markdown-dialect]] configuration setting determines whether CommonMark or Extended CommonMark is used.\n\n=== Use Markdown as the default markup language of Zettelstore\n\nUpdate the [[New Zettel|00000000090001]] template (and other relevant template zettel) by setting the syntax value to \"\"md\"\", \"\"markdown\"\", \"\"commonmark\"\", \"\"cmark\"\", \"\"emark\"\".\nWhether to use \"\"md\"\" or \"\"markdown\"\" is not just a matter of taste.\nThe same applies for \"\"commonmark\"\" / \"\"cmark\"\".\nIt also depends on the value of [[''zettel-file-syntax''|00001004020000#zettel-file-syntax]] and, to some extent, on the value of [[''yaml-header''|00001004020000#yaml-header]].\n\nIf you set ''yaml-header'' to true, then new content is always stored in a file with the extension ''.zettel''.\n\nOtherwise ''zettel-file-syntax'' lists all syntax values, where its content should be stored in a file with the extension ''.zettel''.\n\nIf neither ''yaml-header'' nor ''zettel-file-syntax'' is set, new content is stored in a file whose filename extension matches the zettel's ''syntax'' metadata value.\nIn this case, it makes a difference whether you specify \"\"md\"\" or \"\"markdown\"\", and likewise whether you specify \"\"commonmark\"\" or \"\"cmark\"\".\nIf you specify the ''syntax'' metadata value \"\"md\"\", your content is stored in a file with the ''.md'' extension.\nThe same applies to the values \"\"markdown\"\", \"\"commonmark\"\", \"\"cmark\"\", and \"\"emark\"\".\n\nIf you want to process the files that store the zettel content, e.g. with some other Markdown tools, this may be important.\nNot every Markdown tool allows both file extensions.\n\nBTW, metadata is stored in a file without a file extension, if neither ''yaml-header'' nor ''zettel-file-syntax'' is set.\n\n=== Security aspects\n\nYou should be aware that Markdown is a super-set of HTML.\nThe body of any HTML document is also a valid Markdown document.\nIf you write your own zettel, this is probably not a problem.\n\nHowever, if you receive zettel from others, you should be careful.\nAn attacker might include malicious HTML code in your zettel.\nFor example, HTML allows embedding JavaScript, a full-featured programming language that drives many websites.\nWhen a zettel is displayed, JavaScript code might be executed, sometimes with harmful results.\n\nBy default, Zettelstore prohibits any HTML content.\nIf you want to relax this rule, you should take a look at the startup configuration key [[''insecure-html''|00001004010000#insecure-html]].\n\nEven if you have allowed HTML content, Zettelstore mitigates some of the security problems by ignoring suspicious text when it encodes a zettel as HTML.\nAny HTML text that might contain the ``