Markdown Syntax 1.1
![]() | Markdown 1.1 Syntax Parser and Renderer |
Type | JAR |
Category | Syntax |
Developed by | |
Active Installs | 0 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Compatibility | Ideally should be installed in XWiki 8.2M2+. However, can also be installed on older versions, see below. |
Table of contents
Description
This version of Markdown for XWiki builds on top of Markdown Syntax 1.0 but adds supports for XWiki macros, superscript and subscript markup and inline (X)HTML.
Extra Features
Macros
Block Macros
Example:
content
{{/mymacro}}
Other examples:
- {{mymacro par1=val1 par2="val 2"}}content{{/mymacro}}
- {{mymacro}}content{{/mymacro}}
- {{mymacro par1=val1 /}}
- {{mymacro /}}
Inline Macros
- #[mymacro](par1="foo" par2=42 "any content")
- macro with parameters and content - #[mymacro]("any content (quoted)")}} or {{#[mymacro](any content)
- macro without parameters - #[mymacro]
- macro without parameters and content
Superscript and subscript
Subscripts are similar, just use ~tilda~ instead. Do you want some H~2~O?
Note that spaces inside superscript and subscript symbols need to be escaped using the \ character.
Inline (X)HTML
Markdown supports an inline HTML so you can write e. g. Hello <del>there</del> and these tags are interpreted as HTML. The problem is that the Pegdown parser is too lenient, it allows any number of whitespaces and even optional new line inside a HTML tag. Therefore it's very hard to properly escape < and > characters to not be confused with a HTML.
We've replaced the parsing rules for an inline HTML in the Pegdown parser with rules for an inline XML. The XML syntax is more strict and so more suitable for an inline (X)HTML in the Markdown syntax. One can still write Hello <del>there</del> and it's parsed as (X)HTML, but something like a < b > c is not. It's more predictable and much simpler to properly escape special characters.
For example, the following is not considered as valid XHTML by the Markdown 1.1 parser:
class="red">good</span>
Note that even though the newline after the span is valid XHTML, the Markdown 1.1 parser considers it (wrongly) as invalid and thus is rendered as follows in HTML:
Prerequisites & Installation Instructions
Note that installing this version also installs Markdown Syntax 1.0.
The installation depends on the version of XWiki you have:
- XWiki >= 8.2M2: Nothing special, works fine without any manual setup.
- XWiki == 8.2M1: If you're installing on Jetty, you need to replace the jython-standalone-2.7.0-xwiki-2.jar JAR in WEB-INF/lib by this one
- XWiki < 8.2M1, XWiki < 8.1 or XWiki < 7.4.4:
- You need to remove the existing XWiki Markdown JARs that were bundled at that time (and which have been removed in XWiki 8.2M1). To do so remove the following 2 JARs: WEB-INF/lib/xwiki-rendering-syntax-markdown10-<version>.jar and WEB-INF/lib/xwiki-rendering-syntax-markdown11-<version>.jar.
- You'll need to install the extension JAR (and its dependencies) manually in WEB-INF/lib (i.e. as a core extension). This is caused by the following bug that was fixed in XWiki 7.4.4, 8.1 and 8.2M1.
Also note that when installed with the Extension Manager, the extension needs to be installed "on Farm".