title: Use Markdown within Zettelstore
role: manual
tags: #manual #markdown #zettelstore
syntax: zmk
back: 00001007000000 00001007040324 00001008000000 00001012920522
backward: 00001007000000 00001007040324 00001008000000 00001012920522
box-number: 1
copyright: (c) 2020-present by Detlef Stern <ds@zettelstore.de>
created: 20210126175322
forward: 00000000090001 00001008010500 00001008010800 00001012920500 00001012920510
lang: en
license: EUPL-1.2-or-later
modified: 20260630174914
published: 20260630174914
visibility: public

If you prefer Markdown as your markup language, you can configure Zettelstore accordingly.
Zettelstore supports the [CommonMark](00001008010500) dialect of Markdown, as well as an extended dialect, [Extended CommonMark](00001008010800).

The [`syntax`](00001006020000#syntax) metadata of a zettel determines which Markdown dialect is used:



# Use Markdown as the default markup language of Zettelstore

Update the [New Zettel](00000000090001) template (and other relevant template zettel) by setting the syntax value to &ldquo;md&rdquo;, &ldquo;markdown&rdquo;, &ldquo;commonmark&rdquo;, &ldquo;cmark&rdquo;, &ldquo;emark&rdquo;.
Whether to use &ldquo;md&rdquo; or &ldquo;markdown&rdquo; is not just a matter of taste.
The same applies for &ldquo;commonmark&rdquo; / &ldquo;cmark&rdquo;.
It 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).

If you set `yaml-header` to true, then new content is always stored in a file with the extension `.zettel`.

Otherwise `zettel-file-syntax` lists all syntax values, where its content should be stored in a file with the extension `.zettel`.

If 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.
In this case, it makes a difference whether you specify &ldquo;md&rdquo; or &ldquo;markdown&rdquo;, and likewise whether you specify &ldquo;commonmark&rdquo; or &ldquo;cmark&rdquo;.
If you specify the `syntax` metadata value &ldquo;md&rdquo;, your content is stored in a file with the `.md` extension.
The same applies to the values &ldquo;markdown&rdquo;, &ldquo;commonmark&rdquo;, &ldquo;cmark&rdquo;, and &ldquo;emark&rdquo;.

If you want to process the files that store the zettel content, e.g. with some other Markdown tools, this may be important.
Not every Markdown tool allows both file extensions.

BTW, metadata is stored in a file without a file extension, if neither `yaml-header` nor `zettel-file-syntax` is set.

# Security aspects

You should be aware that Markdown is a super-set of HTML.
The body of any HTML document is also a valid Markdown document.
If you write your own zettel, this is probably not a problem.

However, if you receive zettel from others, you should be careful.
An attacker might include malicious HTML code in your zettel.
For example, HTML allows embedding JavaScript, a full-featured programming language that drives many websites.
When a zettel is displayed, JavaScript code might be executed, sometimes with harmful results.

By default, Zettelstore prohibits any HTML content.
If you want to relax this rule, you should take a look at the startup configuration key [`insecure-html`](00001004010000#insecure-html).

Even if you have allowed HTML content, Zettelstore mitigates some of the security problems by ignoring suspicious text when it encodes a zettel as HTML.
Any HTML text that might contain the `<script>` tag or the `<iframe>` tag is ignored.
This may lead to unexpected results if you depend on these.
Other [encodings](00001012920500) may still contain the full HTML text.

Any external client of Zettelstore, which does not use Zettelstore's [HTML encoding](00001012920510), must be programmed to take care of malicious code.