Markdown
The content editor supports two writing formats, selectable per item: HTML (default rich editor) and Markdown (CodeMirror plain-text editor). The format is stored in $item['content_format']. Themes never need to branch on it — render_content_html() detects it and runs the Markdown conversion automatically before the shortcode pipeline.
Headings
# H1
## H2
### H3
#### H4
Every heading gets an id="toc-{slug}" anchor automatically, compatible with the [toc] shortcode. The toolbar's Headings dropdown covers H1–H4; H5 and H6 aren't in the dropdown but work fine if typed by hand (#####, ######) — the parser supports all six levels.
Inline formatting
| Syntax | Output |
|---|---|
**bold** / __bold__ | bold |
*italic* / _italic_ | italic |
~~strikethrough~~ | |
` inline code | inline code` | |
{#hex:text} | text in that color |
Text color
This word is {#e74c3c:red}, and this one is {#2ecc71:green}.
Renders as <span style="color:#hex">text</span>. Any 3- or 6-digit hex color works. The toolbar's color-picker button inserts this syntax automatically around the selected text — there's no need to memorize the format, but it's plain enough to type by hand. Other inline formatting still works inside the colored span: {#e74c3c:some **bold** word}.
Links and images
[Link text](https://example.com)

Open in a new tab: [Text](https://example.com{:target="_blank"}).
Titles
Both links and images accept an optional title after the URL, in double or single quotes:
[Link text](https://example.com "Shown on hover")

The title becomes the title attribute, as in CommonMark. A title is not a caption — see the warning below.
Reference style
Links and images can also point at a definition placed elsewhere in the document:
See [the docs][docs] and this ![diagram][fig].
[docs]: https://example.com "Optional title"
[fig]: files/diagram.png
Labels are case-insensitive and the definition lines are removed from the output. The collapsed form [docs][] reuses the link text as the label. The shortcut form ([docs] with no second pair of brackets) is not supported — it would collide with shortcode syntax. An unresolved label is left in the page verbatim rather than silently dropped.
Clickable images
Wrap an image in a link to make it clickable. Each part keeps its own optional title:
[](https://example.com "Link tooltip")
Remote images
An image address can point at another site, not just a local file:

This is allowed by the shipped Content-Security-Policy, whose img-src permits any https host. If you have narrowed img-src to an allow-list (see Security), an image from a host outside that list is blocked by the browser and never appears.
That failure is silent and easy to misread as a Markdown problem: the <img> element is still in the page, so its title tooltip works and its alt text shows while the image itself never loads. If images from one particular host don't appear, check img-src before suspecting the syntax.
Image resizing
Append a size hint after the URL and a space:
| Syntax | Effect |
|---|---|
=300x | width="300", height scales automatically |
=x200 | height="200", width unconstrained |
=300x200 | Both dimensions set |
=50%x | Percentage instead of pixels |
Resized images always keep max-width: 100%, so they never overflow on small screens.
Image captions are not supported. A quoted title renders as the image's title attribute — a tooltip — not a visible caption. There is no <figure>/<figcaption> output. If you need a captioned image, write that block as HTML directly (switch that item's content_format to html, or wrap just that image in a raw HTML snippet) rather than Markdown.
Lists
Any of -, *, + for unordered; 1. for ordered. Nesting works at any depth — indent child items by 2+ spaces, and ordered/unordered levels can mix freely:
- Unordered parent
1. Ordered child
2. Ordered child
Blank lines between items are tolerated without closing the list.
Blockquotes
> This is a blockquote.
> It can span multiple lines.
Footnotes
Two-part syntax: an inline marker, and a definition anywhere in the document (conventionally at the bottom).
This claim needs a source.[^1] Multiple citations can stack.[^2] [^3]
[^1]: Author, A. (2023). Title. *Journal*. https://example.com
[^2]: Author, B. (2022). Another title.
[^3]: Author, C. (2021). Third source.
The marker renders as a superscript link; the definition renders as a numbered entry in a <section class="footnotes"> block appended after the content. Labels can be any alphanumeric string ([^1], [^smith2023]) and must be unique within the document — reusing a label silently overrides the earlier definition with the later one.
Horizontal rule
Any of ---, ***, ___.
Tables (GFM)
| Column A | Column B |
|---|---|
| Value 1 | Value 2 |
Column alignment syntax (:---, :---:, ---:) is not supported — all columns render left-aligned.
Fenced code blocks
```php
echo render_content_html($item['content'], $item);
```
Any language identifier works; syntax highlighting is applied client-side (highlight.js), loaded automatically only on pages whose rendered HTML actually contains a code block.
Hard line breaks
Two trailing spaces at the end of a line produce <br>.
Containers (:::)
The Markdown equivalent of the [callout] shortcode:
\x00CALLOUT1\x00
| Alias | Rendered type | Color |
|---|---|---|
info, note | info | Blue |
warning, caution | warning | Orange |
tip, success | tip | Green |
danger, error | danger | Red |
CMS shortcodes in Markdown
All shortcodes work normally — they're preserved intact through Markdown conversion and parsed afterward by the shortcode pipeline: [recent_articles limit="3"], [contact_form], etc.
Square brackets inside fenced code blocks and inline code spans are HTML-entity-encoded during conversion ([ → [), so a code example showing shortcode syntax is never itself parsed as a live shortcode.
Limitations
- No image caption support (see warning above).
- Reference-style shortcut syntax (
[label]alone) is not supported — use[label][]or[text][label]. - Table column alignment is not supported.
- Raw HTML embedded in Markdown passes through as-is — use with care.
- The parser is a lightweight custom implementation, not CommonMark-compliant; complex nested formatting edge cases may not render as expected.
- Footnote labels must be unique per document.
