Loading...

Loading...

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.yml and the actual plugin source in node_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 (raw paired with endraw) 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 declares mathjax: 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: warning

Several 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

FormRenderDescription
: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:

OptionCurrent stateDescription
defsbuilt-in full shortcode tablenot overridden → all names in the official emoji list work
enabledempty = all enablednot configured
shortcutsempty {}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

CaseBehavior
Written inside inline code (`:smile:`)not converted, shown verbatim — emoji only processes text tokens
Written inside a fenced code blockalso not converted
Misspelled shortcode (:smile_face:)output verbatim, no error
ASCII emoticons like :) :Dnot 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:

cover

Corresponding source:

![cover](https://blog.17lai.site/medias_webp/cover/hexo.webp){width=120}

Add id / class / custom attributes to a link:

Effect:

link

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

FormRenderDescription
{#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 elementindependent from Hexo’s heading anchors
![img](url){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 tableattributes 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:

OptionDefaultDescription
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 write onclick=, style= and any other attribute. Multi-author sites should tighten it to [id, class, /^data-/].

2.5 Boundaries & pitfalls

CaseBehavior
Wanting to add attributes to a tablethe 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 textusually still recognized, but values with quotes easily stick to the text; leave a space
Value contains a space without double quotesonly 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

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)

_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

FormRenderDescription
[text](https://example.com)<a target="_blank" rel="noopener noreferrer">external link
[text](/about/)same as aboveinternal relative links also open a new tab
bare URL (linkify: true)automatic <a>, also a new tabe.g. https://hexo.io
[text](#anchor)same as abovein-page anchors also open a new tab

3.4 Parameters & options

OptionCurrent valueEffectiveDescription
attrs.target_blank✅hard-coded target
attrs.relnoopener noreferrer✅prevents reverse tabnabbing
pattern^https?://❌ not effective4.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

CaseBehavior
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 existsapplyAttributes overwrites it
Custom target for a single linkuse 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”
  • pattern is 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 Interface

4.3 All syntax forms

FormRenderDescription
*[ABBR]: full namedefinition line not displayed, only registeredmust occupy its own line
ABBR in the body<abbr title="full name">ABBR</abbr>hover shows the full name
multiple *[A]: ... linesseveral abbreviations active at onceone per line
same abbreviation defined twicethe first definition winslater 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

CaseBehavior
Empty full name (*[X]:)definition invalid; body unchanged
Empty abbreviation or full namethat definition is dropped
Case mismatch (define API, write api)no match, no substitution
Written inside inline code / code blocksnot substituted (only text tokens are processed)
Definition line sandwiched inside a paragraphit 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 name occupies 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.io

5.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

FormRenderDescription
[^id] in the bodysuperscript [1]reference point
[^id]: contentfootnote area at the enddefinition line; position is arbitrary
continuation indented 4 spacesmerged into the same footnotemulti-line / multi-paragraph
numeric id [^1]numbered in order of appearancenumbering 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

CaseBehavior
Two references using the same idboth reference; the second automatically gets a suffixed label [1:1] and shares the same definition
Definition written but never referencednot displayed (never rendered)
Referenced but never definedthe literal [^id] text is shown
id containing spaces/CJKworks but not recommended; anchor readability suffers
Multi-line continuation not indentedthe 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

FormRenderDescription
++text++<ins> underlineinserted content
~~text~~<s> strikethroughnot this plugin — markdown-it’s built-in strikethrough
++multi word text++whole span underlinedspaces allowed

6.4 Parameters & options

Loaded bare, no configurable options.

6.5 Boundaries & pitfalls

CaseBehavior
Only a single +not recognized, shown verbatim
Nesting **bold** inside the markernesting supported; ++**bold**++ bolds normally
Wanting to express deletionuse ~~, not ++
Inside a code blocknot 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

FormRenderDescription
~text~<sub> subscripta single ~
~~text~~<s> strikethroughdouble ~, uses the built-in strikethrough rule
H~2~OH2Ohugging the surrounding characters works

7.4 Parameters & options

Loaded bare, no configurable options.

7.5 Boundaries & pitfalls

CaseBehavior
Using two ~ for subscriptbecomes strikethrough
Spaces inside the markernot recognized (per pandoc rules the content should not contain unescaped spaces)
Other inline syntax nestednot parsed — H~**2**~ shows the literal **2** (the plugin does not support nesting)
Inside a code blocknot 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 210goes through mathjax (section 16).

Corresponding source:

Inline superscript 2^10^ uses the plugin; a real formula $2^{10}$ goes through mathjax (section 16).

8.3 All syntax forms

FormRenderDescription
^text^<sup> superscripta single ^
29^th^29thhugging the surrounding characters
$2^{10}$math formulamathjax, not this plugin

8.4 Parameters & options

Loaded bare, no configurable options.

8.5 Boundaries & pitfalls

CaseBehavior
Spaces inside the markernot recognized
Other inline syntax nestednot parsed; shows the literal text (the plugin does not support nesting)
Writing ^^ consecutively in a table cellthat is multimd-table’s row-merge marker, not superscript
Wanting complex powersuse 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

FormRenderDescription
==text==<mark> highlight backgroundadapts to light/dark mode
==multi word text==whole span highlightedspaces 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

CaseBehavior
Using a single =not recognized
Inline syntax nested insidenesting supported; ==**bold**== applies both highlight and bold
Highlighting a whole large paragraphvisual 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 task

x 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 verification

Capital X and ordered lists:

Effect:

Corresponding source:

1. [X] Capital X also counts as done
2. [ ] Ordered lists work too

10.3 All syntax forms

FormRenderDescription
- [x] content☑ donelowercase x
- [X] content☑ donecapital X is equivalent
- [ ] content☐ not doneone space inside the brackets
1. [ ] contentordered task itemordered lists are supported too
- [x]content (no space)plain textnot rendered

10.4 Parameters & options

Plugin loaded bare → default parameters:

OptionDefaultDescription
disabledtruecheckboxes are not clickable, display only (renders disabled="true")
divWrapfalsedon’t wrap checkboxes in a div
divClasscheckboxclass used only when divWrap: true
idPrefixcbx_checkbox id prefix (cbx_0, cbx_1, …)
ulClasstask-listclass of the list ul
liClasstask-list-itemclass of the list item li

10.5 Boundaries & pitfalls

CaseBehavior
- [x]content (missing space)not recognized; the whole line becomes plain text (including the literal [x])
Wanting to click to checknot possible — disabled: true, display only; for interactivity write your own JS or use another component
Indented nested taskssupported; indentation decides the level
Duplicate checkbox idsids increment from cbx_0 per page, so multiple groups don’t collide
Markdown inside task itemscontent renders normally (bold/links work)

10.6 Summary

  • - [x] / - [ ] — a space is required after the brackets
  • Capital X works 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.yml has rowspan: true enabled).

Learning path: minimal example → common variants (alignment / merging) → all syntax forms → parameters & options → boundaries & pitfalls → summary

11.1 Minimal example

Effect:

FeatureStatusPriority
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:

GroupItemNotes
A
barSecond row
BbazStandalone 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

FormRenderDescription
\| a \| b \|two-column tablebasic syntax
:--- / :--: / ---:left / center / right alignmentwritten in the separator row
\|\| at end of rowhorizontal merge (colspan)omit a cell + add one \|
^^ in a cellvertical merge (rowspan)requires rowspan: true (enabled)
\\\| in a cellliteral pipenot treated as a column separator

11.4 Parameters & options

_config.yml currently enables only one option:

OptionCurrent valueDescription
rowspantrueenables ^^ vertical merging
multilinedefault falsenot enabled: no multi-paragraph content inside cells
headerlessdefault falsenot enabled: tables must have a header row
inlinedefault falsenot enabled

11.5 Boundaries & pitfalls

CaseBehavior
No blank line before the tableit 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 enabledthe cell shows the literal ^^
Needing a pipe inside a cellwrite \|, otherwise it is treated as a column separator
Needing a line break inside a cellrequires multiline, currently off
Combining with attrs to attribute a tablethe 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 (rowspan is enabled)
  • Leave a blank line before the table; escape pipes inside cells

12. imsize (markdown-it-imsize)

Purpose: append =widthxheight after 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:

cover

Corresponding source:

![cover](https://blog.17lai.site/medias_webp/cover/hexo.webp =200x100)

12.2 Common variants

Width only (height follows the original aspect ratio):

Effect:

cover

Corresponding source:

![cover](https://blog.17lai.site/medias_webp/cover/hexo.webp =160x)

Height only:

Effect:

cover

Corresponding source:

![cover](https://blog.17lai.site/medias_webp/cover/hexo.webp =x80)

12.3 All syntax forms

FormRenderDescription
![alt](url =300x200)width="300" height="200"both fixed
![alt](url =300x)width="300"width only
![alt](url =x200)height="200"height only
![alt](url){width=300}attrs form, also validworks 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

CaseBehavior
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 rationot possible; only display size changes — crop with CSS object-fit or preprocess the image
Combining with groupimagesizes and grid column widths squeeze each other; mix with care
A tiny original written at a large sizeblurry after upscaling

12.6 Summary

  • Syntax is url =widthxheight — a space before =
  • 300x / x200 fix only one side
  • Only the display size changes, never the image itself

13. container (markdown-it-container)

Purpose: ::: type renders 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

FormRenderDescription
::: warning … :::<div class="warning">the type name is the class
::: note<div class="note">same name as the note tag, different output
::: tip / ::: hintinfo-blue calloutboth types map to the info semantic color
closing line :::: (longer)closes as wellopening/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
ParameterRequiredDescription
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

CaseBehavior
Wrong type (::: Warning in caps)not a registered container → output as paragraph text verbatim
Opening line not at line startnot recognized; degrades to plain text
Wanting nested containersthe 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 titlenot supported (container has no title concept; use section 14 admon or the note tag)
Empty contentoutputs an empty container, no error
Mixing with the note tagboth 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: !!! type renders a callout with a color bar + tinted background, output as a .admonition structure. 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

FormRenderDescription
!!! tip + 4-space indent + two blank lines<div class="admonition tip">minimal structure
!!! note Titlewith .admonition-titlethe title goes through Markdown
!!! warning ""no titleempty double-quoted string
!!! anywordcorresponding classthe type is not validated
three or more ! (!!!!)still recognizedthe marker needs at least 3

14.5 Parameters & options

ParameterRequiredDefaultDescription
!!! 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✅emptymust be indented (4 spaces from the opening line)
closing—two consecutive blank lines / end of documentno explicit end marker

14.6 Boundaries & pitfalls

CaseBehavior
Content not indenteddoes not enter the container; becomes a normal paragraph
Only one blank line before the next paragraphdoes not close, so the next paragraph is swallowed into the container
Forgetting to close and reaching the endauto-closes at end of document (content may exceed expectations)
Type written in CJKworks, but the class contains CJK and CSS selection is awkward
Wanting nested admononly possible with different indent levels and error-prone; prefer the note tag
Mixing with containerdifferent 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

FormRenderDescription
term newline : description<dl><dt>…<dd>…definition list
multiple : description linesmultiple <dd>sseveral descriptions for one term
term then a blank line then : descriptionstill recognizedblank lines don’t matter (measured)
blank line + 4-space indent continuationmultiple <p> inside <dd>multi-paragraph descriptions supported
:description (no space)not recognizeda 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

CaseBehavior
No space after :treated as an ordinary paragraph (the whole block is output verbatim)
Description continuation not indented 4 spacesbreaks into a normal paragraph, leaving the list
Adjacent to task lists / normal listsdifferent list types; separate them with a blank line
Colons inside the descriptiononly 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 (requires mathjax: true in front-matter).

Learning path: minimal example → block formulas → all syntax forms → parameters & options → boundaries & pitfalls → summary

16.1 Minimal example

Effect:

Inline formula: E=mc2

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:

∫0∞e−x2dx=π2

Corresponding source:

$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

16.3 All syntax forms

FormRenderDescription
$E=mc^2$inline SVG formulaflows with the text
$$\int_0^1 x^2 dx$$standalone block formulabest kept as its own paragraph
\$100literal $100escape when you need to show a dollar sign
\(...\) / \[...\]not supportedmathjax3 5.x hard-codes $ / $$

16.4 Parameters & options

PositionParameterRequiredDescription
front-mattermathjax: true✅without it formulas don’t render (declared on this page)
_config.ymltex.inlineMath: [['$','$']]—ineffective for 5.x (hard-coded in source); only documents intent
_config.ymltex.displayMath: [['$$','$$']]—same as above
_config.ymltex.processEscapes: true—effective: \$ outputs a literal $
_config.ymlsvg.fontCache: global—SVG font cache strategy

16.5 Boundaries & pitfalls

CaseBehavior
Forgetting front-matter mathjax: trueformulas 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/belowmay merge with the previous paragraph
Using \( ... \)not supported; not rendered
_ / ^ in a formula without bracesonly one character applies; multiple characters misalign (LaTeX rules)
Wanting to change the delimiterschanging _config.yml has no effect; you must switch to a texmath/katex solution

16.6 Summary

  • $...$ inline, $$...$$ block — mathjax: true is 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

FormRenderDescription
Mixed CJK/Latin (no markers)line breaks optimized automaticallythe plugin’s only job
中文 English 中文break points at CJK/Latin boundariesnever splits an English word
Pure CJK paragraphlargely unaffectedCJK 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

CaseBehavior
Expecting it to “add spaces automatically”it doesn’t — it only handles line breaking, never inserts visible spaces
Expecting it to work inside code blockscode content is not processed
Stacked with breaks: truefine; newlines inside a paragraph still become <br>
Turning it offdelete 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

PluginSyntaxRendersNotes
emoji:smile:emoji charactershortcode, ready to use; :) is not enabled
attrs{...} after elementinline attributes{#id .class key=val}; tables need two blank lines below
link-attributesany <a>target="_blank"pattern has no effect → internal links also open a new tab
abbr*[ABBR]: full name<abbr> hover tooltipdefinition position arbitrary; applies to the whole post
footnote[^1] + [^1]: contentend-of-post footnotenumbering automatic; unreferenced definitions hidden
ins++text++<ins> underlinerevision mark
sub~text~<sub> subscriptchemical formulas etc.; ~~ is strikethrough
sup^text^<sup> superscriptpowers etc.
mark==text==<mark> highlighthighlighter effect
task-checkbox- [x] / - [ ]checkbox lista space is required after the brackets; checkboxes are not clickable
multimd-tableGFM table<table>:--: controls alignment; \|\| spans columns, ^^ spans rows
imsize![img](url =300x200)sized imagea space before =; display size only
container::: warningdiv.warning7 types registered; no title
admon!!! tip + two blank lines to close.admonition containertypes unrestricted; title customizable
deflistterm + : definition<dl> listmust be adjacent; a space is required after the colon
mathjax3$formula$ / $$formula$$SVG formulaneeds mathjax: true; delimiters hard-coded
cjk-breaksnoneautoCJK 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 declare mathjax: true, otherwise formulas display literally
  • Leave a blank line above and below block formulas $$...$$; escape literal $ with \$
  • link-attributes’ pattern has no effect in 4.0.1 — every body link (including internal and anchor links) gets target="_blank"; config cannot limit it to external links
  • Task list - [x] needs a space after the brackets; - [x]xxx won’t render as a task; checkboxes are a disabled display state
  • The abbr definition line *[abbr]: full name may 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 / ::: hint render 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

  1. Hexo official site: https://hexo.io ↩︎

  2. A deeply customized fork of blinkfox/hexo-theme-matery. ↩︎

  3. Deployed at waline.17lai.site. ↩︎

  4. First line.
    Second line — indented 4 spaces, still part of the same footnote. ↩︎

  5. Layout, Tag plugins, Interactions, Markdown syntax. ↩︎

Comments
Data Loading...