Markdown

The content editor supports two writing formats selectable per item in the admin panel: HTML (the default rich editor) and Markdown. Switching to Markdown replaces the WYSIWYG toolbar with a CodeMirror plain-text editor.

The format is stored in $item['content_format']'html' or 'markdown'. Theme templates do not need to handle this: render_content_html() detects the format and runs the Markdown conversion automatically before the shortcode pipeline.


Supported syntax

Headings

# H1
## H2
### H3
#### H4
##### H5
###### H6

All headings get an id="toc-{slug}" anchor automatically, making them compatible with the [toc] shortcode.


Inline formatting

SyntaxOutput
**bold** or __bold__bold
*italic* or _italic_italic
~~strikethrough~~strikethrough
` inline code | inline code`

[Link text](https://example.com)
![Alt text](files/my-image.jpg)

To open a link in a new tab, append {:target="_blank"} to the URL:

[Opens in new tab](https://example.com{:target="_blank"})

Lists

- Unordered item
* Also unordered
+ Also works

1. First
2. Second
3. Third

Nested lists are not supported — use HTML if you need nesting.


Blockquotes

> This is a blockquote.
> It can span multiple lines.

Horizontal rule

Any of these produce <hr>:

---
***
___

Tables (GFM)

| Column A | Column B | Column C |
|---|---|---|
| Value 1  | Value 2  | Value 3  |

Column alignment syntax (:---, :---:, ---:) is not currently supported — all columns are left-aligned.


Fenced code blocks

php echo rendercontenthtml($item['content'], $item);

`

Any language identifier is supported — syntax highlighting is applied client-side via Highlight.js if loaded by the theme.


Hard line breaks

Two trailing spaces at the end of a line produce <br>:

Line one  
Line two

Containers (:::)

Containers are a Markdown extension that maps to the same callout blocks as the [callout] shortcode. They are the preferred way to add callouts in Markdown content.

<div class="sc-callout sc-callout-info"><span class="sc-callout-icon">&#x2139;&#xFE0F;</span><div class="sc-callout-body"><p>This is an informational note.</p>
</div></div>

<div class="sc-callout sc-callout-warning"><span class="sc-callout-icon">&#x26A0;&#xFE0F;</span><div class="sc-callout-body"><p class="sc-callout-title"><strong>Optional title</strong></p><p>Pay attention to this.</p>
</div></div>

Supported types

AliasRendered typeColour
info, noteinfoBlue
warning, cautionwarningOrange
tip, successtipGreen
danger, errordangerRed

An optional title can follow the type on the same line — it is rendered as a bold paragraph inside the callout body.


Using CMS shortcodes in Markdown

All CMS shortcodes work normally inside Markdown content. They are preserved intact during Markdown conversion and parsed afterward by the shortcode pipeline.

Here is a list of recent articles:

[recent_articles limit="3" category="design"]

And a contact form:

[contact_form]

Shortcodes in code blocks

Square brackets inside fenced code blocks and inline code spans are encoded as HTML entities during conversion ([[, ]]). This prevents the shortcode parser from treating code examples as real shortcodes. The displayed output in the browser is correct.


Limitations

  • Nested lists are not supported.
  • Table column alignment (:---, :---:) is not supported.
  • Raw HTML embedded in Markdown is passed through as-is — use with care.
  • The parser is a lightweight custom implementation, not CommonMark-compliant. Edge cases in complex nested formatting may not render as expected.