Starting with XWiki Enterprise version 1.7 and above we've introduced a new wiki syntax. So we're now naming the current syntax the XWiki Syntax v1.0 and the new syntax is logically called the XWiki Syntax v2.0. The main reasons for introducing the new syntax were:
- Fix the limitations and ambiguities of the XWiki 1.0 syntax (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
- Not optimal symbols. For example the symbol for bold was single stars. This was causing trouble when users were entering text containing stars since that text was mistakenly considered to be bold when it wasn't. Hence we've rationalized the syntax by using at least double characters everywhere.
- Ambiguities. For example there was an ambiguity between a bold item starting a line and a bulletted list. Resolving the ambiguities was required in order to rewrite the WYSIWYG editor so that it could be deterministic.
- Be closer to the Creole 1.0 syntax which is becoming a standard for wiki syntax. In addition the Creole community has taken the time to analyze all the existing wiki syntaxes before deciding on symbols. The choices made are thus very good.
In addition to these 2 XWiki syntaxes we've also changed our underlying rendering engine (was Radeox previously) in favor of our own engine which is superset wrapper around Wikimodel and Doxia (and possibly others in the future). This has allowed us to provide other syntaxes in the wiki: MediaWiki, Confluence, JSPWiki, Creole, TWiki and more
XWiki Syntax v2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.
Description | Example of invalid or ambiguous syntax | Fixed XWiki Syntax 2.0 |
---|
Not closed tet styles | **bold | **bold** |
Two standalone elements not separated by 2 new lines | | table cell * list item | | table cell
* list item |
Two standalone elements not separated by 2 new lines | paragraph ---- paragraph | paragraph
----
paragraph |
Ignored new line at beginning of document | <new line at beginning of document> paragraph | paragraph |
Not closed header syntax | === header | === header === |
Paragraphs
Paragraphs are text elements separated by 2 or more new lines.
InformationIn XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 1.2 |
---|
Simple paragraph | This is a paragraph | This is a paragraph | This is a paragraph | This is a paragraph |
Paragraph on multiple lines | Paragraph on\\ multiple lines | Paragraph on multiple lines | Paragraph on multiple lines | Paragraph on multiple lines |
Two paragraphs | Paragraph one
Paragraph two | Paragraph one
Paragraph two | Paragraph one
Paragraph two | Paragraph one
Paragraph two |
Parametrized paragraph | <p style="text-align:center;color:blue">Centered and blue paragraph</p> | (% style="text-align:center;color:blue" %) Centered and blue paragraph | Centered and blue paragraph | Centered and blue paragraph |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Standard headers | 1 level 1 1.1 level 2 1.1.1 level 3 1.1.1.1 level 4 1.1.1.1.1 level 5 1.1.1.1.1.1 level 6 |
= level 1 =
== level 2 ==
=== level 3 ===
==== level 4 ====
===== level 5 =====
====== level 6 ======
|
level 1 level 2level 3level 4level 5level 6 |
Parametrized headers | <h1><span style="color:blue">header</span></h1> | (% style="color:blue" %) = header = | |
Headers with wiki syntax | 1.1.1 Header with *bold* | === Header with **bold** === | |
Text Formatting
InformationNew in XWiki Syntax 2.0 over XWiki Syntax 1.0:
- Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not * bold *).
- Use double symbols when there was only a single symbol in XWiki Syntax 1.0 so that it's less likely that the user will mistakenly use them in text.
- Ability to span several lines (wasn't the case in XWiki Syntax 1.0).
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Bold | *bold* | **bold** | bold |
Underline | __underline___ | __underline__ | underline |
Italics | ~~italic~~ | //italic// | ~italic~ |
Striked out | --strike-- | --strike-- | strike |
Monospace | <tt>monospace</tt> | ##monospace## | monospace |
Superscript | some <sup>superscript</sup> | some ^^superscript^^ | some superscript |
Subscript | some <sub>subscript</sub> | some ,,subscript,, | some subscript |
Horizontal Line
InformationThere must be 4 or more dashes.
InformationNote that this is different from Creole where exactly 4 dashes are required.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Simple Horizontal Line | ---- | ---- |
|
Parametrized Horizontal Line | <hr style="color:blue"/> |
(% style="color:blue" %)
----
|
|
Lists
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Bulleted list |
* item 1
** item 2
*** item 3
* item 4
|
* item 1
** item 2
*** item 3
* item 4
| |
Numbered list |
1. item 1
11. item 2
111. item 3
1. item 4
|
1. item 1
11. item 2
111. item 3
1. item 4
| |
Mixed list |
1. item 1
1*. item 2
1*. item 3
1. item 4
|
1. item 1
1*. item 2
1*. item 3
1. item 4
| |
Square list | |
(% style="list-style-type: square" %)
* item 1
* item 2
| |
Disc list | <ul style="list-style-type: disc"> <li>item1</li> <li>item2</li> </ul> |
(% style="list-style-type: disc" %)
* item 1
* item 2
| |
Lowercase Alphabetical list | |
(% style="list-style-type: lower-alpha" %)
* item1
* item2
| |
Uppercase Alphabetical list | |
(% style="list-style-type: upper-alpha" %)
* item1
* item2
| |
Lowercase Roman list | |
(% style="list-style-type: lower-roman" %)
* item1
* item2
| |
Uppercase Roman list | |
(% style="list-style-type: upper-roman" %)
* item1
* item2
| |
Lowercase Greek list | |
(% style="list-style-type: lower-greek" %)
* item1
* item2
| |
Uppercase Greek list | |
(% style="list-style-type: upper-greek" %)
* item1
* item2
| |
Hiragana list | |
(% style="list-style-type: hiragana" %)
* item1
* item2
| |
Hiragana Iroah list | |
(% style="list-style-type: hiragana-iroha" %)
* item1
* item2
| |
Katakana list | |
(% style="list-style-type: katakana" %)
* item1
* item2
| |
Katakana Iroha list | |
(% style="list-style-type: katakana-iroha" %)
* item1
* item2
| |
Armenian list |
<ul style="list-style-type: armenian">
<li>item1</li>
<li>item2</li>
</ul>
|
(% style="list-style-type: armenian" %)
* item1
* item2
| |
Hebrew list | |
(% style="list-style-type: hebrew" %)
* item1
* item2
| |
Georgian list |
<ul style="list-style-type: georgian">
<li>item1</li>
<li>item2</li>
</ul>
|
(% style="list-style-type: georgian" %)
* item1
* item2
| |
CJK ideographic list |
<ul style="list-style-type: cjk-ideographic">
<li>item1</li>
<li>item2</li>
</ul>
|
(% style="list-style-type: cjk-ideographic" %)
* item1
* item2
| |
Definition Lists
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Standard definition |
<dl>
<dt>term</dt>
<dd>definition</dd>
</dl>
| | |
Nested definitions |
<dl>
<dt>term1</dt>
<dd>definition1
<dl>
<dt>term2</dt>
<dd>definition2</dd>
</dl>
</dd>
</dl>
|
; term1
: definition1
:; term2
:: definition2
| - term1
- definition1
- term2
- definition2
|
Parametrized definition |
<dl style="color:blue">
<dt>term</dt>
<dd>definition</dd>
</dl>
|
(% style="color:blue" %)
; term
: definition
| |
New Line/Line breaks
A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.
InformationIn XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|
Line break | Line\\New line | Line\\New line | Line New line | Line New line |
New line | Line New line | Line New line | Line New line | Line New line |
Links
XWiki Syntax 1.0 Link Specification
The full format of a link is (alias[|>])+(link)(@interWikiAlias)+([|>]target)+
- alias: An optional string which will be displayed to the user as the link name when rendered. Example: "My Page".
- link: The full link reference using the following syntax: (virtualWikiAlias+(space.)+(reference)(?queryString)+(#anchor)+
- Note that either the link or the alias must be specified.
- virtualWikiAlias: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: "mywiki".
- space: An optional Wiki Space name. If not space is specified the current space is used. Example: "Main".
- reference: The link reference. This can be either a URI in the form protocol:path (example: "http://xwiki.org", "mailto:john@smith.com") or a wiki page name (example: "WebHome").
- queryString: An optional query string for specifying parameters that will be used in the rendered URL. Example: "mydata1=5&mydata2=Hello".
- anchor: An optional anchor name pointing to an anchor defined in the referenced link. Note that in XWiki anchors are automatically created for titles. Example: "TableOfContentAnchor".
- interWikiAlias: An optional Inter Wiki alias as defined in the InterWiki Map (see the Admin Guide). Example: "wikipedia"
- target: An optional string corresponding to the HTML target attribute for a HTML A link element. This element is used when rendering the link. It defaults to opening the link in the current page. Examples: "_self", "_blank"
XWiki Syntax 2.0 Link Specification
The full format of a link is (label>>)?(link)(||parameters)*
- label: the link label, can contain wiki syntax
- link: the link target, i.e. where to go when the link is clicked. It has a similar format than in the XWiki 1.0 syntax and it can also contain 2 types of URIs: mailto: and ## for linking to an email and linking to an attachment respectively.
- parameters: An optional list of parameters passed to the link.
Tables
Allows to easily create content in table format. It also support parameters for table, row or cell in XWiki Syntax 2.0.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Standard table | (((
{table}
Title 1 | Title 2
Word 1 | Word 2
{table}
))) |
|=Title 1|=Title 2
|Word 1|Word 2
| Title 1 | Title 2 |
---|
Word 1 | Word 2 |
|
Parametrized table | <table style="background-color:red;align:center"> <tbody> <tr> <td>Title 1</td> <td style="background-color:yellow">Title 2</td> </tr> <tr> <td>Word 1</td> <td>Word 2</td> </tr> </tbody> </table> |
(% style="background-color:red;align=center" %)
|=Title 1|=(% style="background-color:yellow" %)Title 2
|Word 1|Word 2
| Title 1 | Title 2 |
---|
Word 1 | Word 2 |
|
Filterable Sortable table |
$xwiki.ssfx.use("js/xwiki/table/table.css")
$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
<table id="tableid" class="grid sortable filterable doOddEven">
<tr class="sortHeader">
<th>Title1</th>
<th>Title2</th>
</tr>
<tr>
<td>Cell11</td>
<td>Cell12</td>
</tr>
<tr>
<td>Cell21</td>
<td>Cell22</td>
</tr>
</table>
|
{{velocity}}
$xwiki.ssfx.use("js/xwiki/table/table.css")
$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
{{/velocity}}
{{html}}
<table id="tableid" class="grid sortable filterable doOddEven">
<tr class="sortHeader">
<th>Title1</th>
<th>Title2</th>
</tr>
<tr>
<td>Cell11</td>
<td>Cell12</td>
</tr>
<tr>
<td>Cell21</td>
<td>Cell22</td>
</tr>
</table>
{{/html}}
| Erreur dans l'exécution de la macro [html]. Cause : [When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro.]. Cliquer sur ce message pour voir plus de détails. org.xwiki.rendering.macro.MacroExecutionException: When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro. at org.xwiki.rendering.internal.transformation.macro.HTMLRawBlockFilter.cleanHTML(HTMLRawBlockFilter.java:133) at org.xwiki.rendering.internal.transformation.macro.HTMLRawBlockFilter.filter(HTMLRawBlockFilter.java:80) at org.xwiki.rendering.internal.macro.XWikiHTMLRawBlockFilter.filter(XWikiHTMLRawBlockFilter.java:63) at org.xwiki.rendering.internal.macro.html.HTMLMacro.execute(HTMLMacro.java:160) at org.xwiki.rendering.internal.macro.html.HTMLMacro.execute(HTMLMacro.java:70) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:311) at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183) at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:88) at org.xwiki.display.internal.DocumentContentAsyncExecutor.executeInCurrentExecutionContext(DocumentContentAsyncExecutor.java:396) at org.xwiki.display.internal.DocumentContentAsyncExecutor.execute(DocumentContentAsyncExecutor.java:269) at org.xwiki.display.internal.DocumentContentAsyncRenderer.execute(DocumentContentAsyncRenderer.java:112) at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:157) at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:54) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:290) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267) at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.execute(DefaultBlockAsyncRendererExecutor.java:125) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:67) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:43) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:123) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42) at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1388) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1524) at com.xpn.xwiki.doc.XWikiDocument.displayDocument(XWikiDocument.java:1474) at com.xpn.xwiki.doc.XWikiDocument.displayDocument(XWikiDocument.java:1443) at com.xpn.xwiki.api.Document.displayDocument(Document.java:788) at jdk.internal.reflect.GeneratedMethodAccessor740.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:704) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:75) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:242) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147) at org.xwiki.velocity.internal.directive.TryCatchDirective.render(TryCatchDirective.java:86) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439) at org.apache.velocity.Template.merge(Template.java:358) at org.apache.velocity.Template.merge(Template.java:262) at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225) at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:105) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:174) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:135) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284) at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267) at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:904) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:866) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:853) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:808) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:800) at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79) at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73) at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54) at jdk.internal.reflect.GeneratedMethodAccessor302.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439) at org.apache.velocity.Template.merge(Template.java:358) at org.apache.velocity.Template.merge(Template.java:262) at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225) at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:105) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:174) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:135) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284) at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267) at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:904) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:866) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:853) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:808) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:800) at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79) at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73) at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54) at jdk.internal.reflect.GeneratedMethodAccessor302.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:171) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439) at org.apache.velocity.Template.merge(Template.java:358) at org.apache.velocity.Template.merge(Template.java:262) at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225) at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:105) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:219) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:174) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:135) at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284) at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284) at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267) at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:904) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:866) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:846) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:832) at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:91) at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:85) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2564) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:651) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:339) at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:108) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:354) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Unknown Source)
|
Images
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Image from attachment in current page | | image:img.png | |
Image from attachment in another document | {image:img.png|document=Space.Page} | image:Space.Page@img.png | |
Image with parameters | {image:img.png|width=25|height=25} | [[image:img.png||width="25" height="25"]] | |
Images located at URL | http://some/url/img.png | image:http://some/url/img.png | |
Verbatim
Allow to enter content that will not be formatted (in other words the wiki syntax will not be taken into account).
InformationIn XWiki Syntax 1.0 the Pre macro only preserves wiki syntax and Radeox macros. However HTML snippets and Groovy/Velocity scripts are still executed.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|
Verbatim inline | Some verbatim {pre}*[not rendered]*{/pre} content | Some verbatim {{{**[[not rendered]]**}}} content | Some verbatim *[not rendered]* content | Some verbatim **[[not rendered]]** content |
Verbatim block |
{pre}
multi line
*verbatim*
content
{/pre}
InformationIt's also possible to use the Code macro but it displays its content in a box by default. |
{{{
multi line
**verbatim**
content
}}}
|
multi line
*verbatim*
content
|
multi line
**verbatim**
content
|
Quotations
Allows to quote some text.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
Simple quote | <blockquote><p>john said this</p></blockquote> I said ok |
> john said this
I said ok
| |
Nested quotes | <blockquote><p>john said this</p> <blockquote><p>marie answered that</p></blockquote> </blockquote> I said ok |
> john said this
>> marie answered that
I said ok
| john said this marie answered that
I said ok |
Groups
Groups can be used to insert another document inline directly into the current document. This allows for example to insert complex elements inside a list item or inside a table cell. Groups are delimited by the following syntactic elements: (((...))). One Group can contain another Group and there is no limit of imbrication.
XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
InformationThis feature doesn't exist in XWiki syntax 1.0. You'd have to use pure HTML to achieve the result. |
|=Header 1|=Header 2|=Header 3
|Cell One|(((
= Embedded document
Some embedded paragraph.
* list item one
* list item two
** sub-item 1
** sub-item 2
))) | Cell Three
Next paragraph in the top-level document
| Header 1 | Header 2 | Header 3 |
---|
Cell One | Embedded documentSome embedded paragraph. - list item one
- list item two
| Cell Three |
Next paragraph in the top-level document |
Escapes
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|
Escape a character | This is not a \[link\] | This is not a ~[~[link~]~] InformationTo enter a ~ character use a double escape: ~~ | This is not a [link] | This is not a [[link]] |
Macros
There are 2 kinds of macros in XWiki syntax 1.0:
- Velocity macros (called using the #macroname(param1 ... paramN) syntax)
- Radeox macros (called using the {macroname:param1=value1|...|paramN=valueN} syntax)
There are also 2 kinds of macros in XWiki Syntax 2.0:
- Velocity macros (called using the #macroname(param1 ... paramN) syntax inside the Velocity Macro)
- XWiki macros (called using the {{macroname param1="value1" ... paramN="valueN"}} syntax)
InformationThe Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 |
---|
Velocity Macro | |
{{velocity}}{{html}}
#info("some text")
{{/html}}{{/velocity}}
InformationWe're using the HTML macro in the example since the #info macro returns HTML content. InformationStarting with XE 2.0 you should use the Message Macro to implement this example. |
Radeox Macro/XWiki Macros |
{code:java}
java content
{code}
|
{{code language="java"}}
java content
{{/code}}
|
HTML
InformationIn XWiki Syntax 2.0 HTML or XHTML must be entered by using the HTML macro whereas in XWiki Syntax 1.0 it's possible to enter HTML directly in the text.
XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|
<b>bold</b> | {{html}}<b>bold</b>{{/html}} | bold |
InformationIn XWiki Syntax 2.0, by default the HTML macro does not understands wiki syntax (other macros included since it's wiki syntax too). To enable it, use {{html wiki="true"}}.
Velocity/Groovy Scripts
InformationIn XWiki Syntax 1.0 it was possible to enter Velocity scripts anywhere directly in the page. This lead to issues for example when the user was involuntarily entering Velocity content. It was also performance hungry for pages not requiring Velocity content. There were several other technical limitations. Thus in XWiki Syntax 2.0 Velocity scripts must be entered using the velocity macro. Same goes for entering Groovy scripts.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 |
---|
Velocity script | |
{{velocity}}
#set ($var = "whatever")
{{/velocity}}
|
Groovy script |
<%
def var = "whatever"
%>
|
{{groovy}}
def var = "whatever"
{{/groovy}}
|
Parameters
With XWiki Syntax 2.0 it's possible to pass parameters to the different syntax elements and also to blocks of text. This is used for example to style them. You can set any parameter key/value pair you want. The XHTML renderer will pass these parameters as XHTML attributes to the underlying XHTML representation of the different syntax elements. In XWiki Syntax 1.0 there was no syntax for passing parameters and the only way to do it was to write XHTML directly in the content as shown in the table below.
XWiki Syntax 1.0 | XWiki Syntax 2.0 | Generated XHTML |
---|
<h1 class="myClass" style="myStyle" id="myId">header</h1>
|
(% class="myClass" style="myStyle" id="myId" %)
= header =
|
<h1 class="myClass" style="myStyle" id="myId">header</h1>
|
Other syntaxes
The following other syntaxes are implemented in XWiki Enterprise 1.6 and later:
WarningThe implementation for these syntaxes is not fully finished yet. For example support for links is not working perfectly yet. We also need to define if we want to extend the original syntaxes to support XWiki-specific features like ability to link to another sub-wiki.