Markdown Syntax Extensions
This page summarizes the 17 markdown-it plugins enabled by the theme via hexo-renderer-markdown-it (emoji / attrs / link-attributes / abbr / footnote / ins / sub / sup / mark / task-checkbox / multimd-table / imsize / container / admon / deflist / mathjax3 / cjk-breaks; config in the root _config.yml), plus a combined example and a quick reference. Each plugin gives its purpose, syntax, example and effect — examples can be copied directly into a post for testing.
How to read this page: every syntax is shown as matched pairs of Effect → Corresponding source — see the real render first, then copy the Markdown below it. The parameter tables and “Boundaries & pitfalls” sections all come from the plugin config in
_config.ymland the actual plugin source innode_modules, not guesses.Unlike the inline bold-label style of the “Layout & Pages” chapter, this page uses third-level subheadings (minimal example / common variants / all syntax forms / parameters & options / boundaries & pitfalls / summary) because it needs to host code blocks and live rendering examples.
Note: code blocks that demonstrate syntax are always wrapped with raw tags (rawpaired withendraw) to prevent nunjucks from mishandling them or swallowing following content during pre-rendering.
Note: this page contains real math formula examples (item 16), so front-matter declaresmathjax: true— whenever a post body contains$...$/$$...$$formulas you MUST declare it, otherwise formulas display literally.
1. emoji (markdown-it-emoji)
Purpose: use emoji shortcodes directly in Markdown, no need to copy Unicode characters.
Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
1.1 Minimal example
Effect:
😄
Corresponding source:
:smile:Wrap the English shortcode in colons — no configuration needed.
1.2 Common variants
Effect:
😄 smile | ❤️ heart | 🚀 rocket | 👍 thumbs up | 🎉 celebrate | ⚠️ warning
Corresponding source:
:smile: smile | :heart: heart | :rocket: rocket | :+1: thumbs up | :tada: celebrate | :warning: warningSeveral shortcodes can be written in a row, or embedded mid-sentence.
Effect:
Remember ✅ to run the tests before committing; don’t 🙈 push directly.
Corresponding source:
Remember :white_check_mark: to run the tests before committing; don't :see_no_evil: push directly.1.3 All syntax forms
| Form | Render | Description |
|---|---|---|
:smile: | 😄 | standard shortcode (name from the emoji cheat sheet) |
:smile::heart: | 😄❤️ | several in a row, no space needed |
:+1: | 👍 | names may contain +, - and digits |
:not_a_real_emoji: | :not_a_real_emoji: | undefined shortcodes are output verbatim |
1.4 Parameters & options
_config.yml loads it bare (- markdown-it-emoji, no options), so plugin defaults apply:
| Option | Current state | Description |
|---|---|---|
defs | built-in full shortcode table | not overridden → all names in the official emoji list work |
enabled | empty = all enabled | not configured |
shortcuts | empty {} | ASCII shortcuts (e.g. :)) are not enabled |
To trim/customize, switch to the object form in _config.yml:
- name: markdown-it-emoji
options:
enabled: [smile, heart]1.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Written inside inline code (`:smile:`) | not converted, shown verbatim — emoji only processes text tokens |
| Written inside a fenced code block | also not converted |
Misspelled shortcode (:smile_face:) | output verbatim, no error |
ASCII emoticons like :) :D | not rendered — shortcuts is not enabled |
Wrong casing (:Smile:) | the table is all lowercase; a casing mismatch means no match |
1.6 Summary
- Wrap the shortcode in colons; look names up on an emoji cheat sheet
- ASCII emoticons are not enabled —
:)is not an emoji - To narrow the available set, pass
options.enabled
2. Inline Attributes attrs (markdown-it-attrs)
Purpose: append
{#id .class key=val}after an element to add id / class / custom attributes — handy for fine-tuning styles or anchor targets.Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
2.1 Minimal example
Add an inline style to a paragraph — the most direct way to see attrs at work:
Effect:
The color of this text is controlled by {style=...}, not by the theme’s default color.
Corresponding source:
The color of this text is controlled by `{style=...}`, not by the theme's default color.{style="color:#c2185b"}2.2 Common variants
Set image width/height (resize without the imsize plugin):
Effect:

Corresponding source:
{width=120}Add id / class / custom attributes to a link:
Effect:
Corresponding source:
[link](https://example.com){.external #link1 data-x="1"}Add attributes to a fenced code block (written at the end of the info string):
Effect:
{.demo-block}console.log('the pre element of this block has class="demo-block"');
Corresponding source:
```js {.demo-block}
console.log('the pre element of this block has class="demo-block"');
```2.3 All syntax forms
| Form | Render | Description |
|---|---|---|
{#custom-id} | id="custom-id" | anchor target |
{.class1 .class2} | class="class1 class2" | multiple classes, space-separated |
{key=val} | key="val" | custom attribute, e.g. data-*, width |
{key="with space"} | key="with space" | values containing spaces must be double-quoted |
paragraph text{...} | attributes land on <p> | written at end of line |
# Heading {#id} | attributes land on the heading element | independent from Hexo’s heading anchors |
{width=120} | attributes land on <img> | values may be unquoted |
```js {.cls} | attributes land on <pre> | written in the info string |
{.cls} two blank lines below a table | attributes land on <table> | must be two blank lines, otherwise it does not apply |
2.4 Parameters & options
Plugin version 4.5.0, loaded bare from _config.yml → all defaults:
| Option | Default | Description |
|---|---|---|
leftDelimiter | { | left delimiter |
rightDelimiter | } | right delimiter |
allowedAttributes | [] (empty = allow all) | whitelist; an empty array means any attribute is allowed |
Security note:
allowedAttributes: []means the body can writeonclick=,style=and any other attribute. Multi-author sites should tighten it to[id, class, /^data-/].
2.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
| Wanting to add attributes to a table | the attribute block must be two blank lines below the table; attached directly it does not apply |
Inline and block elements both match (e.g. {...} at the end of a list item) | inline wins — the attribute is added to <strong>, not <li> |
Wrapping an attributed link in _italic_ | parse conflict; {target=" breaks italic parsing — use * emphasis instead |
| No space between the attribute block and the text | usually still recognized, but values with quotes easily stick to the text; leave a space |
| Value contains a space without double quotes | only the first segment is taken; the rest becomes body text |
| Written after an unsupported element (e.g. alone on a blank line) | shown as plain text |
2.6 Summary
{...}must sit at the end of the element’s line (tables are the exception: two blank lines below)#id/.class/key=val; quote values that contain spaces- All attributes are allowed by default — multi-author sites should tighten the whitelist
3. External Link Attributes link-attributes (markdown-it-link-attributes)
Purpose: add
target="_blank"+rel="noopener noreferrer"to links site-wide — open in a new tab and prevent reverse tabnabbing.Learning path: minimal example → real behavior of internal links → all syntax forms → parameters & options → boundaries & pitfalls → summary
3.1 Minimal example
Effect:
external link — opens in a new tab when clicked.
Corresponding source:
[external link](https://example.com)3.2 Internal links also open in a new tab (actual behavior)
_config.yml writes pattern: ^https?://, but the current plugin version (4.0.1) does not read pattern at all — the source only recognizes a matcher function and attrs. A function cannot be expressed in YAML, so the first config entry unconditionally matches every <a>:
Effect:
internal link /about/ and anchor link also get target="_blank" (verify with right-click → Inspect).
Corresponding source:
[internal link /about/](/about/) and [anchor link](<#1-emoji-markdown-it-emoji>) also get `target="_blank"` (verify with right-click → Inspect).3.3 All syntax forms
| Form | Render | Description |
|---|---|---|
[text](https://example.com) | <a target="_blank" rel="noopener noreferrer"> | external link |
[text](/about/) | same as above | internal relative links also open a new tab |
bare URL (linkify: true) | automatic <a>, also a new tab | e.g. https://hexo.io |
[text](#anchor) | same as above | in-page anchors also open a new tab |
3.4 Parameters & options
| Option | Current value | Effective | Description |
|---|---|---|---|
attrs.target | _blank | ✅ | hard-coded target |
attrs.rel | noopener noreferrer | ✅ | prevents reverse tabnabbing |
pattern | ^https?:// | ❌ not effective | 4.0.1 has no pattern branch; only the matcher function is recognized |
To really process only external links you can only switch to a form expressible in _config.yml (not supported today), or pick out http(s) links with a front-end script/post-render step in the theme layer — changing pattern in YAML has no effect at all.
3.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Changing pattern to ^https:// | no change — the parameter is ignored; attributes are still added to everything |
Internal links getting rel="noopener noreferrer" | no functional harm, but semantically redundant |
| The same attribute already exists | applyAttributes overwrites it |
Custom target for a single link | use attrs: [x](url){target=_self}; execution order is attrs first, link-attributes afterwards → it still becomes _blank |
| Linked images | <img> is not <a>, unaffected |
3.6 Summary
- The effect is “every
<a>on the entire site opens a new tab”, not “external links only” patternis a decorative config; changing it does nothing (4.0.1 has no such branch)- A single link cannot be switched back to the same tab via config
4. abbr (markdown-it-abbr)
Purpose: define abbreviations; hovering shows the full name (generates an
<abbr>tag).Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
4.1 Minimal example
The definition line *[abbr]: full name occupies its own line; wherever the term appears in the body it is automatically wrapped in <abbr>:
Effect:
W3C defines Web standards.
Corresponding source:
*[W3C]: World Wide Web Consortium
W3C defines Web standards.4.2 Common variants
Multiple abbreviations (one definition per line):
Effect:
HTML handles structure, CSS handles styling.
Corresponding source:
*[HTML]: Hyper Text Markup Language
*[CSS]: Cascading Style Sheets
HTML handles structure, CSS handles styling.Definitions also work at the end of the post (measured: the plugin substitutes after whole-block and inline parsing, so position is irrelevant):
Effect:
The term API appears first; its definition is below.
Corresponding source:
The term API appears first; its definition is below.
*[API]: Application Programming Interface4.3 All syntax forms
| Form | Render | Description |
|---|---|---|
*[ABBR]: full name | definition line not displayed, only registered | must occupy its own line |
ABBR in the body | <abbr title="full name">ABBR</abbr> | hover shows the full name |
multiple *[A]: ... lines | several abbreviations active at once | one per line |
| same abbreviation defined twice | the first definition wins | later ones are ignored |
4.4 Parameters & options
Loaded bare, no configurable options. The definition area is maintained by the plugin in state.env.abbreviations; body substitution is done for the whole post at once.
4.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Empty full name (*[X]:) | definition invalid; body unchanged |
| Empty abbreviation or full name | that definition is dropped |
Case mismatch (define API, write api) | no match, no substitution |
| Written inside inline code / code blocks | not substituted (only text tokens are processed) |
| Definition line sandwiched inside a paragraph | it breaks the paragraph — the definition line must stand alone |
| Assuming “the definition must precede first use” | not required; position is arbitrary (older docs were wrong; corrected against the source) |
4.6 Summary
- The definition line
*[abbr]: full nameoccupies its own line - Position is arbitrary and applies to the whole post
- Case-sensitive; no substitution inside code
5. footnote (markdown-it-footnote)
Purpose: show notes/sources collectively at the end of the post, referenced by superscript numbers in the body.
Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
5.1 Minimal example
Effect:
Hexo is a fast static blog framework[1].
Corresponding source:
Hexo is a fast static blog framework[^hexo].
[^hexo]: Hexo official site: https://hexo.io5.2 Common variants
Named ids (easier to maintain than numbers; adding/removing entries never shifts them):
Effect:
The theme is matery[2] and comments are Waline[3].
Corresponding source:
The theme is matery[^matery] and comments are Waline[^waline].
[^matery]: A deeply customized fork of blinkfox/hexo-theme-matery.
[^waline]: Deployed at waline.17lai.site.Multi-line footnotes (continuation lines indented 4 spaces):
Effect:
A multi-line footnote can contain two paragraphs[4].
Corresponding source:
A multi-line footnote can contain two paragraphs[^multi].
[^multi]: First line.
Second line — indented 4 spaces, still part of the same footnote.5.3 All syntax forms
| Form | Render | Description |
|---|---|---|
[^id] in the body | superscript [1] | reference point |
[^id]: content | footnote area at the end | definition line; position is arbitrary |
| continuation indented 4 spaces | merged into the same footnote | multi-line / multi-paragraph |
numeric id [^1] | numbered in order of appearance | numbering is assigned by the plugin |
5.4 Parameters & options
Loaded bare, no configurable options. The render structure is fixed: sup.footnote-ref + hr.footnotes-sep + section.footnotes + an ordered list, with back-links carrying ↩︎.
5.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
| Two references using the same id | both reference; the second automatically gets a suffixed label [1:1] and shares the same definition |
| Definition written but never referenced | not displayed (never rendered) |
| Referenced but never defined | the literal [^id] text is shown |
| id containing spaces/CJK | works but not recommended; anchor readability suffers |
| Multi-line continuation not indented | the second line breaks off into a normal paragraph |
5.6 Summary
- Reference
[^id], define[^id]: content; position doesn’t matter - Numbering is automatic; named ids are easier to maintain
- Unreferenced definitions are not displayed
6. ins (markdown-it-ins)
Purpose:
++text++renders as underlined inserted text (like a revision mark).Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
6.1 Minimal example
Effect:
This is inserted content.
Corresponding source:
This is ++inserted content++.6.2 Common variants
Revision scenario (combined with strikethrough to express “what was removed, what was added”):
Effect:
The old approach polling WebSocket push.
Corresponding source:
The old approach ~~polling~~ ++WebSocket push++.Combined with highlight:
Effect:
Added dark mode support.
Corresponding source:
++Added ==dark mode== support++.6.3 All syntax forms
| Form | Render | Description |
|---|---|---|
++text++ | <ins> underline | inserted content |
~~text~~ | <s> strikethrough | not this plugin — markdown-it’s built-in strikethrough |
++multi word text++ | whole span underlined | spaces allowed |
6.4 Parameters & options
Loaded bare, no configurable options.
6.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Only a single + | not recognized, shown verbatim |
Nesting **bold** inside the marker | nesting supported; ++**bold**++ bolds normally |
| Wanting to express deletion | use ~~, not ++ |
| Inside a code block | not converted |
6.6 Summary
++means “added”,~~means “removed”- Don’t put complex nesting inside
7. sub (markdown-it-sub)
Purpose:
~text~renders as subscript.Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
7.1 Minimal example
Effect:
H2O is the chemical formula of water.
Corresponding source:
H~2~O is the chemical formula of water.7.2 Common variants
Chemical formulas / variable subscripts:
Effect:
CO2 is carbon dioxide; array elements are written ai.
Corresponding source:
CO~2~ is carbon dioxide; array elements are written a~i~.Distinguishing from strikethrough (the easiest place to get confused):
Effect:
H2O is subscript, H2O is strikethrough.
Corresponding source:
H~2~O is subscript, ~~H2O~~ is strikethrough.7.3 All syntax forms
| Form | Render | Description |
|---|---|---|
~text~ | <sub> subscript | a single ~ |
~~text~~ | <s> strikethrough | double ~, uses the built-in strikethrough rule |
H~2~O | H2O | hugging the surrounding characters works |
7.4 Parameters & options
Loaded bare, no configurable options.
7.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Using two ~ for subscript | becomes strikethrough |
| Spaces inside the marker | not recognized (per pandoc rules the content should not contain unescaped spaces) |
| Other inline syntax nested | not parsed — H~**2**~ shows the literal **2** (the plugin does not support nesting) |
| Inside a code block | not converted |
7.6 Summary
- Subscript uses a single
~; strikethrough uses double~~ - Nesting is not supported
8. sup (markdown-it-sup)
Purpose:
^text^renders as superscript.Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
8.1 Minimal example
Effect:
210 = 1024.
Corresponding source:
2^10^ = 1024.8.2 Common variants
English ordinals:
Effect:
29th , 1st , 2nd .
Corresponding source:
29^th^ , 1^st^ , 2^nd^ .Distinguishing from math formulas:
Effect:
Inline superscript 210 uses the plugin; a real formula
Corresponding source:
Inline superscript 2^10^ uses the plugin; a real formula $2^{10}$ goes through mathjax (section 16).8.3 All syntax forms
| Form | Render | Description |
|---|---|---|
^text^ | <sup> superscript | a single ^ |
29^th^ | 29th | hugging the surrounding characters |
$2^{10}$ | math formula | mathjax, not this plugin |
8.4 Parameters & options
Loaded bare, no configurable options.
8.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
| Spaces inside the marker | not recognized |
| Other inline syntax nested | not parsed; shows the literal text (the plugin does not support nesting) |
Writing ^^ consecutively in a table cell | that is multimd-table’s row-merge marker, not superscript |
| Wanting complex powers | use mathjax $...$ |
8.6 Summary
^is superscript,~is subscript- Hand complex formulas to mathjax
9. mark (markdown-it-mark)
Purpose:
==text==renders as highlighter emphasis.Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
9.1 Minimal example
Effect:
Pay special attention to password security.
Corresponding source:
Pay special attention to ==password security==.9.2 Common variants
Multiple highlights:
Effect:
Back up → Verify → Then delete the original; the order cannot be reversed.
Corresponding source:
==Back up== → ==Verify== → ==Then delete the original==; the order cannot be reversed.9.3 All syntax forms
| Form | Render | Description |
|---|---|---|
==text== | <mark> highlight background | adapts to light/dark mode |
==multi word text== | whole span highlighted | spaces allowed |
9.4 Parameters & options
Loaded bare, no configurable options; the highlight color comes from the mark rules in the theme CSS.
9.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Using a single = | not recognized |
| Inline syntax nested inside | nesting supported; ==**bold**== applies both highlight and bold |
| Highlighting a whole large paragraph | visual noise; highlight keywords only |
9.6 Summary
==double equals for highlight- Use sparingly; don’t paint whole paragraphs
10. task-checkbox (markdown-it-task-checkbox)
Purpose: render task lists with checkboxes.
Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
10.1 Minimal example
Effect:
Corresponding source:
- [x] Completed task
- [ ] Uncompleted taskx inside the brackets means done; a space means not done.
10.2 Common variants
A real checklist:
Effect:
Corresponding source:
- [x] Theme test post created
- [x] Automated test scripts
- [ ] Visual regression verificationCapital X and ordered lists:
Effect:
Corresponding source:
1. [X] Capital X also counts as done
2. [ ] Ordered lists work too10.3 All syntax forms
| Form | Render | Description |
|---|---|---|
- [x] content | ☑ done | lowercase x |
- [X] content | ☑ done | capital X is equivalent |
- [ ] content | ☐ not done | one space inside the brackets |
1. [ ] content | ordered task item | ordered lists are supported too |
- [x]content (no space) | plain text | not rendered |
10.4 Parameters & options
Plugin loaded bare → default parameters:
| Option | Default | Description |
|---|---|---|
disabled | true | checkboxes are not clickable, display only (renders disabled="true") |
divWrap | false | don’t wrap checkboxes in a div |
divClass | checkbox | class used only when divWrap: true |
idPrefix | cbx_ | checkbox id prefix (cbx_0, cbx_1, …) |
ulClass | task-list | class of the list ul |
liClass | task-list-item | class of the list item li |
10.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
- [x]content (missing space) | not recognized; the whole line becomes plain text (including the literal [x]) |
| Wanting to click to check | not possible — disabled: true, display only; for interactivity write your own JS or use another component |
| Indented nested tasks | supported; indentation decides the level |
| Duplicate checkbox ids | ids increment from cbx_0 per page, so multiple groups don’t collide |
| Markdown inside task items | content renders normally (bold/links work) |
10.6 Summary
- [x]/- [ ]— a space is required after the brackets- Capital
Xworks too - Checkboxes are a disabled display state and cannot be clicked
11. multimd-table (markdown-it-multimd-table)
Purpose: standard GFM tables + alignment control + cell merging (
_config.ymlhasrowspan: trueenabled).Learning path: minimal example → common variants (alignment / merging) → all syntax forms → parameters & options → boundaries & pitfalls → summary
11.1 Minimal example
Effect:
| Feature | Status | Priority |
|---|---|---|
| Basic | ✅ | High |
| Advanced | ✅ | Medium |
| Experimental | ⚠️ | Low |
Corresponding source:
| Feature | Status | Priority |
| :---- | :--: | -----: |
| Basic | ✅ | High |
| Advanced | ✅ | Medium |
| Experimental | ⚠️ | Low |The colon position in the separator row decides alignment: :--- left, :--: center, ---: right.
11.2 Common variants
Merged cells (|| merges horizontally, ^^ merges vertically):
Effect:
| Group | Item | Notes |
|---|---|---|
| A | ||
| bar | Second row | |
| B | baz | Standalone row |
Corresponding source:
| Group | Item | Notes |
| :-- | :--: | :-- |
| A | foo ||
| ^^ | bar | Second row |
| B | baz | Standalone row |Horizontal merge: omit one cell in a row and end with ||, increasing the colspan of the cell to the left. Vertical merge: write ^^ to mean “merge with the same column of the previous row”.
11.3 All syntax forms
| Form | Render | Description |
|---|---|---|
\| a \| b \| | two-column table | basic syntax |
:--- / :--: / ---: | left / center / right alignment | written in the separator row |
\|\| at end of row | horizontal merge (colspan) | omit a cell + add one \| |
^^ in a cell | vertical merge (rowspan) | requires rowspan: true (enabled) |
\\\| in a cell | literal pipe | not treated as a column separator |
11.4 Parameters & options
_config.yml currently enables only one option:
| Option | Current value | Description |
|---|---|---|
rowspan | true | enables ^^ vertical merging |
multiline | default false | not enabled: no multi-paragraph content inside cells |
headerless | default false | not enabled: tables must have a header row |
inline | default false | not enabled |
11.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
| No blank line before the table | it hugs the paragraph above and may not be recognized as a table |
Rows with inconsistent column counts (without \|\|/^^) | missing cells are simply not output (no padding); extras are dropped |
Using ^^ without rowspan enabled | the cell shows the literal ^^ |
| Needing a pipe inside a cell | write \|, otherwise it is treated as a column separator |
| Needing a line break inside a cell | requires multiline, currently off |
| Combining with attrs to attribute a table | the attribute block must go two blank lines below the table |
11.6 Summary
- Alignment comes from the colons in the separator row
||spans columns,^^spans rows (rowspanis enabled)- Leave a blank line before the table; escape pipes inside cells
12. imsize (markdown-it-imsize)
Purpose: append
=widthxheightafter the image URL to control the display size, no CSS needed.Learning path: minimal example → common variants → all syntax forms → parameters & options → boundaries & pitfalls → summary
12.1 Minimal example
Effect:

Corresponding source:
12.2 Common variants
Width only (height follows the original aspect ratio):
Effect:

Corresponding source:
Height only:
Effect:

Corresponding source:
12.3 All syntax forms
| Form | Render | Description |
|---|---|---|
 | width="300" height="200" | both fixed |
 | width="300" | width only |
 | height="200" | height only |
{width=300} | attrs form, also valid | works without imsize (see section 2) |
12.4 Parameters & options
Loaded bare, no configurable options. It outputs HTML width / height attributes: it only constrains display size, it never crops the original image.
12.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
No space before = (url=300x200) | treated as part of the URL; the size has no effect |
Writing =300X200 (capital X) | the whole thing is not recognized as an image; Markdown is shown verbatim |
| Wanting to crop to a ratio | not possible; only display size changes — crop with CSS object-fit or preprocess the image |
| Combining with groupimage | sizes and grid column widths squeeze each other; mix with care |
| A tiny original written at a large size | blurry after upscaling |
12.6 Summary
- Syntax is
url =widthxheight— a space before= 300x/x200fix only one side- Only the display size changes, never the image itself
13. container (markdown-it-container)
Purpose:
::: typerenders a callout container with a color bar + tinted background. The theme registers 7 types:warning/note/info/attention/error/tip/hint.Learning path: minimal example → seven types → all syntax forms → parameters & options → boundaries & pitfalls → summary
13.1 Minimal example
Effect:
This is a warning container — content that needs attention!
Corresponding source:
::: warning
This is a warning container — content that needs attention!
:::13.2 Seven types
Effect:
note — supplementary explanation.
info — informational hint.
attention — cautionary notice.
error — serious error.
tip — a small trick.
hint — an implicit hint.
Corresponding source:
::: note
note — supplementary explanation.
:::
::: info
info — informational hint.
:::
::: attention
attention — cautionary notice.
:::
::: error
error — serious error.
:::
::: tip
tip — a small trick.
:::
::: hint
hint — an implicit hint.
:::13.3 All syntax forms
| Form | Render | Description |
|---|---|---|
::: warning … ::: | <div class="warning"> | the type name is the class |
::: note | <div class="note"> | same name as the note tag, different output |
::: tip / ::: hint | info-blue callout | both types map to the info semantic color |
closing line :::: (longer) | closes as well | opening/closing only need the same type |
13.4 Parameters & options
_config.yml registers them separately as 7 object entries (a bare use registers no container):
- name: markdown-it-container
options: warning
- name: markdown-it-container
options: note
# … info / attention / error / tip / hint likewise| Parameter | Required | Description |
|---|---|---|
| opening-line type | ✅ | must match a registered value exactly and be lowercase |
| container content | ❌ | rendered as Markdown (lists/code/tables all fine) |
closing line ::: | ✅ | no need to repeat the type name |
13.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Wrong type (::: Warning in caps) | not a registered container → output as paragraph text verbatim |
| Opening line not at line start | not recognized; degrades to plain text |
| Wanting nested containers | the inner container may render, but the closing marker is easily eaten by the outer one (stray ::: text appears) — nesting is not recommended |
| Wanting a custom title | not supported (container has no title concept; use section 14 admon or the note tag) |
| Empty content | outputs an empty container, no error |
| Mixing with the note tag | both work, but two callout styles on one page look cluttered |
13.6 Summary
- Three-line structure:
::: type+ content +::: - The type must be lowercase and registered (7 types)
- No title/collapse capability — use admon or note when you need them
14. Admonition admon (markdown-it-admon)
Purpose:
!!! typerenders a callout with a color bar + tinted background, output as a.admonitionstructure. It is a separate plugin from section 13’s container: different marker (!!!vs:::), different output (<div class="admonition tip">vs<div class="tip">).Learning path: minimal example → custom title and no title → arbitrary types → all syntax forms → parameters & options → boundaries & pitfalls → summary
14.1 Minimal example
Content is indented 4 spaces, and the block is closed by two consecutive blank lines:
Effect:
Tip
This is a tip container — a hint.
Corresponding source:
!!! tip
This is a tip container — a hint.
14.2 Custom title and no title
The title comes after the type (space-separated); the default title is the type name with its first letter capitalized; write "" for no title:
Effect:
Custom title: pre-deploy checklist
You can write your own title.
This block has no title, only a body.
Corresponding source:
!!! note Custom title: pre-deploy checklist
You can write your own title.
""
This block has no title, only a body.
14.3 Arbitrary types
The type is not restricted (validate only checks that the tag is non-empty); whatever you write becomes the class, and the theme CSS decides the styling:
Effect:
info
Info block.
Example
The type name can be anything; without matching CSS it falls back to the base style.
Corresponding source:
!!! info
Info block.
!!! example Example
The type name can be anything; without matching CSS it falls back to the base style.
14.4 All syntax forms
| Form | Render | Description |
|---|---|---|
!!! tip + 4-space indent + two blank lines | <div class="admonition tip"> | minimal structure |
!!! note Title | with .admonition-title | the title goes through Markdown |
!!! warning "" | no title | empty double-quoted string |
!!! anyword | corresponding class | the type is not validated |
three or more ! (!!!!) | still recognized | the marker needs at least 3 |
14.5 Parameters & options
| Parameter | Required | Default | Description |
|---|---|---|---|
!!! marker | ✅ | — | at least 3 ! |
| type (first word) | ✅ | — | non-empty is enough; lowercased into the class |
| title (remaining words) | ❌ | type name with first letter capitalized | "" means no title |
| block content | ✅ | empty | must be indented (4 spaces from the opening line) |
| closing | — | two consecutive blank lines / end of document | no explicit end marker |
14.6 Boundaries & pitfalls
| Case | Behavior |
|---|---|
| Content not indented | does not enter the container; becomes a normal paragraph |
| Only one blank line before the next paragraph | does not close, so the next paragraph is swallowed into the container |
| Forgetting to close and reaching the end | auto-closes at end of document (content may exceed expectations) |
| Type written in CJK | works, but the class contains CJK and CSS selection is awkward |
| Wanting nested admon | only possible with different indent levels and error-prone; prefer the note tag |
| Mixing with container | different output classes (admonition xxx vs xxx) and different styles |
14.7 Summary
!!!+ indented content + two blank lines to close- The default title is the type name;
""removes it - Types are not validated, but a type without CSS only gets the base style
15. deflist (markdown-it-deflist)
Purpose: render definition lists (term + one or more descriptions).
Learning path: minimal example → multiple definitions → all syntax forms → parameters & options → boundaries & pitfalls → summary
15.1 Minimal example
The term goes on one line; descriptions start with : (colon + space):
Effect:
- Hexo
- A fast, simple and powerful blog framework.
Corresponding source:
Hexo
: A fast, simple and powerful blog framework.15.2 Multiple definitions
One term can carry multiple descriptions:
Effect:
- Hexo
- A fast, simple and powerful blog framework.
- Written in Node.js.
Corresponding source:
Hexo
: A fast, simple and powerful blog framework.
: Written in Node.js.15.3 All syntax forms
| Form | Render | Description |
|---|---|---|
term newline : description | <dl><dt>…<dd>… | definition list |
multiple : description lines | multiple <dd>s | several descriptions for one term |
term then a blank line then : description | still recognized | blank lines don’t matter (measured) |
| blank line + 4-space indent continuation | multiple <p> inside <dd> | multi-paragraph descriptions supported |
:description (no space) | not recognized | a space is required after the colon |
15.4 Parameters & options
Loaded bare, no configurable options. Outputs <dl> / <dt> / <dd>; the theme bolds terms and indents descriptions.
15.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
No space after : | treated as an ordinary paragraph (the whole block is output verbatim) |
| Description continuation not indented 4 spaces | breaks into a normal paragraph, leaving the list |
| Adjacent to task lists / normal lists | different list types; separate them with a blank line |
| Colons inside the description | only a leading : is recognized; body colons don’t matter |
15.6 Summary
- The term occupies its own line; descriptions start with
:(a space is required after the colon) - Blank lines don’t affect recognition, but indentation decides whether a line joins the same description
- One term can have several descriptions, and each can be multi-paragraph
16. mathjax3 (markdown-it-mathjax3)
Purpose: render LaTeX math formulas:
$...$inline,$$...$$block (requiresmathjax: truein front-matter).Learning path: minimal example → block formulas → all syntax forms → parameters & options → boundaries & pitfalls → summary
16.1 Minimal example
Effect:
Inline formula:
Corresponding source:
Inline formula: $E=mc^2$16.2 Block formulas
Leave a blank line above and below a block formula so it is not glued to a paragraph:
Effect:
Corresponding source:
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$16.3 All syntax forms
| Form | Render | Description |
|---|---|---|
$E=mc^2$ | inline SVG formula | flows with the text |
$$\int_0^1 x^2 dx$$ | standalone block formula | best kept as its own paragraph |
\$100 | literal $100 | escape when you need to show a dollar sign |
\(...\) / \[...\] | not supported | mathjax3 5.x hard-codes $ / $$ |
16.4 Parameters & options
| Position | Parameter | Required | Description |
|---|---|---|---|
| front-matter | mathjax: true | ✅ | without it formulas don’t render (declared on this page) |
_config.yml | tex.inlineMath: [['$','$']] | — | ineffective for 5.x (hard-coded in source); only documents intent |
_config.yml | tex.displayMath: [['$$','$$']] | — | same as above |
_config.yml | tex.processEscapes: true | — | effective: \$ outputs a literal $ |
_config.yml | svg.fontCache: global | — | SVG font cache strategy |
16.5 Boundaries & pitfalls
| Case | Behavior |
|---|---|
Forgetting front-matter mathjax: true | formulas don’t render (verbatim or plain text) |
An unescaped $ in the body (prices, shell variables) | treated as the start of a formula; following text is swallowed into it |
Block $$ with no blank lines above/below | may merge with the previous paragraph |
Using \( ... \) | not supported; not rendered |
_ / ^ in a formula without braces | only one character applies; multiple characters misalign (LaTeX rules) |
| Wanting to change the delimiters | changing _config.yml has no effect; you must switch to a texmath/katex solution |
16.6 Summary
$...$inline,$$...$$block —mathjax: trueis mandatory- Escape a literal
$as\$ - Delimiters are hard-coded in the plugin; config cannot change them
17. cjk-breaks (markdown-it-cjk-breaks)
Purpose: improve CJK typesetting: avoid line breaks in wrong places in mixed Chinese/English text.
Learning path: minimal example → all syntax forms → parameters & options → boundaries & pitfalls → summary
17.1 Minimal example
Effect:
这是中文测试内容,混合 English 和 2026 年的数字,断行位置更符合中文阅读习惯。
Corresponding source:
这是中文测试内容,混合 English 和 2026 年的数字,断行位置更符合中文阅读习惯。The plugin inserts zero-width break opportunities at CJK/Latin/digit boundaries (<wbr> / word-break related handling); the body needs no markers at all.
17.2 All syntax forms
| Form | Render | Description |
|---|---|---|
| Mixed CJK/Latin (no markers) | line breaks optimized automatically | the plugin’s only job |
中文 English 中文 | break points at CJK/Latin boundaries | never splits an English word |
| Pure CJK paragraph | largely unaffected | CJK can break between characters anyway |
17.3 Parameters & options
Loaded bare, no configurable options — _config.yml has just one line: - markdown-it-cjk-breaks # CJK typesetting optimization.
17.4 Boundaries & pitfalls
| Case | Behavior |
|---|---|
| Expecting it to “add spaces automatically” | it doesn’t — it only handles line breaking, never inserts visible spaces |
| Expecting it to work inside code blocks | code content is not processed |
Stacked with breaks: true | fine; newlines inside a paragraph still become <br> |
| Turning it off | delete that line from _config.yml; generally not recommended |
17.5 Summary
- No syntax, no config — write Chinese and you benefit automatically
- Only line breaking, no space insertion
18. Combined Example (Multiple Plugins)
Purpose: verify that multiple plugins coexist on one page without fighting.
Learning path: combined effect → corresponding source
18.1 Combined effect
Effect:
Task list (task-checkbox):
Definition list (deflist):
- Markdown
- A lightweight markup language.
- Invented by John Gruber.
Footnote (footnote): the tutorial wiki has 4 chapters in total[5].
Multiple plugins work together on the same page without interfering.
18.2 Corresponding source
Corresponding source:
*[API]: Application Programming Interface
**Task list** (task-checkbox):
- [x] emoji works: :white_check_mark:
- [x] abbr works: API
- [x] math works: $a^2 + b^2 = c^2$
**Definition list** (deflist):
Markdown
: A lightweight markup language.
: Invented by John Gruber.
**Footnote** (footnote): the tutorial wiki has 4 chapters in total[^total].
[^total]: Layout, Tag plugins, Interactions, Markdown syntax.Appendix: markdown-it Plugin Quick Reference
| Plugin | Syntax | Renders | Notes |
|---|---|---|---|
| emoji | :smile: | emoji character | shortcode, ready to use; :) is not enabled |
| attrs | {...} after element | inline attributes | {#id .class key=val}; tables need two blank lines below |
| link-attributes | any <a> | target="_blank" | pattern has no effect → internal links also open a new tab |
| abbr | *[ABBR]: full name | <abbr> hover tooltip | definition position arbitrary; applies to the whole post |
| footnote | [^1] + [^1]: content | end-of-post footnote | numbering automatic; unreferenced definitions hidden |
| ins | ++text++ | <ins> underline | revision mark |
| sub | ~text~ | <sub> subscript | chemical formulas etc.; ~~ is strikethrough |
| sup | ^text^ | <sup> superscript | powers etc. |
| mark | ==text== | <mark> highlight | highlighter effect |
| task-checkbox | - [x] / - [ ] | checkbox list | a space is required after the brackets; checkboxes are not clickable |
| multimd-table | GFM table | <table> | :--: controls alignment; \|\| spans columns, ^^ spans rows |
| imsize |  | sized image | a space before =; display size only |
| container | ::: warning | div.warning | 7 types registered; no title |
| admon | !!! tip + two blank lines to close | .admonition container | types unrestricted; title customizable |
| deflist | term + : definition | <dl> list | must be adjacent; a space is required after the colon |
| mathjax3 | $formula$ / $$formula$$ | SVG formula | needs mathjax: true; delimiters hard-coded |
| cjk-breaks | none | auto | CJK typesetting optimization |
Common pitfalls:
- Code blocks that demonstrate syntax MUST be wrapped with raw tags (raw/endraw paired), preventing nunjucks pre-render errors or swallowed content
- When a post body contains
$...$/$$...$$formulas, front-matter MUST declaremathjax: true, otherwise formulas display literally - Leave a blank line above and below block formulas
$$...$$; escape literal$with\$ link-attributes’patternhas no effect in 4.0.1 — every body link (including internal and anchor links) getstarget="_blank"; config cannot limit it to external links- Task list
- [x]needs a space after the brackets;- [x]xxxwon’t render as a task; checkboxes are adisableddisplay state - The abbr definition line
*[abbr]: full namemay appear anywhere (substitution happens after whole-block parsing), but must occupy its own line - container registers
warning/note/info/attention/error/tip/hint(7 types);::: tip/::: hintrender as info-blue callouts - admon starts with
!!!, indents content, and closes with two consecutive blank lines; a single blank line does not end it - multimd-table’s
^^is a row merge, not superscript;||spans columns - When combining tables with attrs, the attribute block must go two blank lines below the table