content

Last modified by Lucas Charpentier on 2026/10/27 10:27

Audit

Macro ID
content
Source
XS
Type
Wrapper
Classification reason
Its output is the content the user types, parsed in the syntax given by the syntax parameter. With the advanced source parameter the content comes from a script variable instead, a rarer use.
Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-14
Auditor
Compared macros
html code

Sources

Where to gather the information the criteria are checked against, see Gather the sources.

SourceWhat it givesUsed forWhere
DocumentationParameters, default values and examples, including the most common exampleL2, L3, and the criteria measured with the most common examplehttps://extensions.xwiki.org/xwiki/bin/view/Extension/Content%20Macro#HUsage
Source codeHow the macro declares its parameters and content: types, groups, features, advanced and hidden flags, constraints, content type, inline supportC4, C5, C7, C8, C9, C13, E4, E6https://github.com/xwiki/xwiki-rendering/blob/xwiki-rendering-18.8.0/xwiki-rendering-macros/xwiki-rendering-macro-content/src/main/java/org/xwiki/rendering/internal/macro/content/ContentMacro.java
Macro descriptorWhat the Edit Macro dialog is built from, on design.xwiki.orgD1, D2, C1 to C9, E4Descriptor, list of macros with their categories
TranslationsThe name, description and parameter names in each languageD1, D2, D4, C1l10n.xwiki.org
Uses in XWiki pagesHow XWiki itself uses the macro, a realistic example when the documentation has noneL3, C2, C3, C6, C8, C9Search the xwiki organization on GitHub
Compared macrosThe audits of the macros of the same typeL1, D3html, code
Other sources specific to this macro
  • ContentMacroParameters.java: syntax is typed as a Syntax, source is advanced, with no other constraint.
  • Macro tests: the uses the macro is tested for, HTML and XHTML content, inline use and the string source. No page of XWiki itself uses the macro.
CriterionResultNotes
D1 wordingOKthe measure is met, no technical word, but "Content" says little about what the macro produces, content written in another syntax, and is also the label of the content field of every macro.
D2 summaryOK
D3 categoryOKin Content, like include and display. The compared macros, html and code, are in Development and Formatting, so the measure gives no single expected category: Content fits a macro that inserts content.
D4 quick-actionKOQuick Actions finds the macro first for "content", "Content", the synonym "markup" and the German name "Inhalt". The synonyms "markdown" and "syntax" give no result, for example "/markdown" in a page, although writing Markdown in an XWiki 2.1 page is a main use of the macro. The French name "Contenu" comes first in the Quick Actions results too, but the probe did not find the entry inserting the macro in French.
L1 consistencyOKcompared with html and code. Their Quick Actions open the Edit Macro dialog and the content is typed in a text area, while content is inserted at once with a rich text content edited in place; html requires its content, while content and code have an optional content, since the source parameter can give it instead. The differences are by design: the content of html and code is code, the content of this macro is rendered.
L2 doc-parametersKOthe parameters are documented only on the legacy extensions.xwiki.org page, with no page in the new documentation. That page also gives syntax as not optional, while the macro uses the current syntax when it is empty, since XWiki 15.1, and does not document the content.
L3 doc-exampleKOthe example of the documentation, {{content syntax="confluence/1.0"}}This is *bold* too!{{/content}} , renders the error "Can't find descriptor for the component with type [interface org.xwiki.rendering.parser.Parser] and hint [confluence/1.0]" on XWiki Standard, which has no Confluence parser; the usage example holds a <syntax id> placeholder. The audit uses the same example with a syntax of XWiki Standard: {{content syntax="html/5.0"}}<p>This is <strong>bold</strong> too!</p>{{/content}} .
I1 patternOK
I2 zero-configKOminor: the macro inserted from Quick Actions, or by the Edit Macro dialog submitted with the default values, is {{content}} {{/content}} : an empty content in the syntax of the page, which renders nothing in view mode and only an empty line in the editor, with no placeholder saying what it is.
I3 instantOK
I4 cursorOK
I5 focusN/A
E1 wysiwygOK
E2 errorsKOan unavailable syntax gives a technical message that names neither the parameter nor how to fix it: {{content syntax="markdown/1.2"}}x{{/content}} renders "Failed to execute the [content] macro. Cause: [Can't find descriptor for the component with type [interface org.xwiki.rendering.parser.Parser] and hint [markdown/1.2]]". The source parameter gives understandable messages, like "Unsupported source type [foo]" for {{content source="foo:bar"/}} , and a malformed syntax gives "Invalid Syntax format [abc]".
E3 nestingKOthe example renders in a list item, a table cell and a box, and a list, a table and a box render and can be edited inside its content. But in a list item and in a table cell, like * {{content syntax="html/5.0"}}<p>This is <strong>bold</strong> too!</p>{{/content}} , the macro is inline and its content cannot be edited in place.
E4 inline-supportOKthe macro declares inline support and renders inside a sentence, with no block element, as in Before {{content syntax="html/5.0"}}<p>This is <strong>bold</strong> too!</p>{{/content}} after. .
E5 emptyOK
E6 inplaceKOthe content is edited in place as rich text, and saved back in the syntax of the macro. But the Edit Macro dialog of an existing macro still shows the content in a text area, converted to the syntax of the page instead of the syntax of the macro, and submitting it unchanged breaks the content: for {{content syntax="html/5.0"}}<p>This is <strong>bold</strong> too!</p>{{/content}} , the dialog shows "This is bold too!", and after Submit the page is saved as {{content syntax="html/5.0"}}<p>This is **bold** too!</p>{{/content}} , which displays the asterisks instead of bold text. This needs two distinct tickets: the generic text area of the dialog, and this conversion bug of the content macro, which loses data.

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
$contentKOOKN/AOKN/AOKN/AN/AN/AN/A

C1, minor: the description "The content to execute" uses a wrong term: the content is parsed in the syntax given by the syntax parameter and displayed, not executed. The French translation repeats it, "Le contenu à exécuter".

C4: edited in place as rich text; the text area of the Edit Macro dialog is recorded under E6.

sourceKOOKOKOKOKOKOKOKOKN/A

C1, minor: the description "the reference of the content to insert (e.g. string:bold, script:myvariable)" does not say that the source replaces the content of the macro. The descriptor in the source code says it, "instead of the content of the macro", but the translation dropped it.

C4: a free text field, which fits: the content macro only supports the string: and script: types, {{content source="page:XWiki.XWikiSyntaxBold"/}} gives "Unsupported source type [page]", so no picker applies.

C7: source and the content are alternative ways to give the content, the source replacing the content, but the Edit Macro dialog cannot present them as one choice, since only parameters can be part of a feature. A limitation of the macro system, listed in the Cross-macro findings, reported as XWIKI-25456.

C9: advanced, and used by the documentation example that displays a script variable, {{content source="script:myvar"/}} .

syntaxOKOKKOKOOKOKN/AOKOKOK

C3: the field opens empty, which means the syntax of the page, while the most common example sets html/5.0. Nothing in the field shows which syntax the empty value stands for.

C4: a free text field for a syntax identifier, although the accepted values are the input syntaxes installed on the wiki, which a select could list. The user has to know the identifiers, and the description suggests "confluence/1.0", which XWiki Standard does not provide: {{content syntax="markdown/1.2"}}x{{/content}} is accepted by the dialog and fails at rendering, see E2.

C13: the parameter is typed as a Syntax, so its format is declared; a well-formed but unavailable syntax is covered by C4.

KOs and tickets

Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.

KOCriterionExisting ticketsNew tickets
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXINFRA-525
L3L3 doc-exampleXINFRA-526
I2I2 zero-configXWIKI-25569
E2E2 errorsXWIKI-16048 (partial)XCOMMONS-3847 (partial), XRENDERING-823 (partial)
E3E3 nestingCKEDITOR-248, XWIKI-19954, XWIKI-23309 (partial)
E6E6 inplaceXWIKI-25443 (partial), XWIKI-25584
C1:$contentC1 clarity, $contentXWIKI-25493
C1:sourceC1 clarity, sourceXWIKI-25493
C3:syntaxC3 defaults, syntaxXRENDERING-550
C4:syntaxC4 input-assistance, syntaxXWIKI-16048
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
CKEDITOR-248ExistingE3
XRENDERING-550ExistingC3:syntax
XWIKI-16048ExistingC4:syntaxE2
XWIKI-19954ExistingE3
XWIKI-23309ExistingE3
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25443NewE6
XWIKI-25444NewD4
XWIKI-25493NewC1:$content C1:source
XINFRA-525NewL2
XINFRA-526NewL3
XWIKI-25569NewI2
XWIKI-25584NewE6

Known issues of this macro

IssueTitleStatusCriteria
XRENDERING-550Provide good defaults for the 'Content' macro parametersOpenC3
XWIKI-16048List the available syntaxes in the Content macro's parameters modalOpenC4

68 more known issues affect every macro: see the Known issues.

Get Connected