Markdown 1.2 Syntax

Last modified by Vincent Massol on 2026/09/28 14:37

Reference

The CommonMark Markdown 1.2 syntax follows the CommonMark 0.29 specification for headings, emphasis, lists, quotes, code, links, images and HTML, and adds the following constructs, which CommonMark doesn't have.

Use the CommonMark link syntax for URLs and email addresses, and the wiki link syntax for pages of the wiki. In a wiki link, the reference and the parameters use the XWiki Syntax 2.1 link format, and the label and parameters are optional.

SyntaxExampleResult
Wiki link[[Sandbox home|Sandbox.WebHome]]Link to the Sandbox.WebHome page, labelled "Sandbox home"
Wiki link without label[[Sandbox.WebHome]]Link to the page, labelled with its title
Wiki link with parameters[[Sandbox home|Sandbox.WebHome|queryString="a=b&c=d" anchor="anchor"]]Link to the page with the a=b&c=d query string and the anchor anchor
URL without bracketsSee https://www.xwiki.orgThe URL becomes a link

Images

Use the CommonMark image syntax for image URLs, and the wiki image syntax for images attached to pages of the wiki. The wiki image reference uses the XWiki Syntax 2.1 format, its image: prefix is optional, and the label is the alternative text.

SyntaxExampleResult
Wiki image![[Logo|[email protected]]]Image XWikiLogo.png attached to Sandbox.WebHome
Wiki image with prefix![[Logo|image:[email protected]]]Same image

Macros

All the XWiki macros are available, with the same syntax inline and on their own lines. The content of a macro that holds wiki content, such as info or box, is written in Markdown.

SyntaxExampleResult
Macro without parameters or content{{toc/}}Table of contents of the page
Macro with parameters{{id name="here"/}}here anchor
Macro with parameters and content{{box title="Note"}}Some *emphasized* text{{/box}}Box titled "Note", with "emphasized" in italics
Inline macroRemember: {{info}}meetings are on Monday{{/info}}.Information message inside the paragraph

The content of a macro can span several lines:

{{info}}
Meetings take place every *Monday*.
{{/info}}

Text formatting

SyntaxExampleResult
StrikethroughSome ~~deleted~~ textSome text with "deleted" struck through
Superscript2^10^ is 1024210 is 1024
SubscriptH~2~OH2O
Superscript and subscript with spaces^with spaces^ and ~with spaces~ textwith spaces and with spaces text

Tables, definition lists and abbreviations

SyntaxExampleResult
AbbreviationThe W3C maintains HTML. *[W3C]: World Wide Web Consortium *[HTML]: Hyper Text Markup Language"W3C" and "HTML" show their definition on mouse over
Definition listMarkdown : A lightweight markup languageTerm "Markdown" followed by its definition
Table| Name | Role | |---|---| | Alice | Admin |Table with a "Name" and a "Role" header; the spaces around cell content are ignored

Groups

Markdown Syntax 8.10.0+

A group holds several blocks, such as paragraphs and lists, with parameters such as class, style or id, like (% class="box" %)(((...))) in XWiki Syntax 2.1. Write it as a div whose attributes are the group parameters, with the opening and the closing tags each alone on their own line, separated from the content by blank lines. The content is written in Markdown, and groups can be nested. For example, this group displays an information box:

<div class="box infomessage">

This is **important**.

* Read the rules

</div>

Any other div, such as <div>text</div> on a single line, is displayed as HTML.

Related

Get Connected