html

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

Audit

Macro ID
html
Source
XS
Type
Generator
Classification reason
Generator, like the script macros: the output is what the browser renders from the HTML typed in the content, which the reader never sees as typed. The parameters only change how the content is processed.
Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-16
Auditor
Compared macros
velocity groovy

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/HTML%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/master/xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.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, D3velocity, groovy
Other sources specific to this macro
CriterionResultNotes
D1 wordingOK
D2 summaryOK
D3 categoryOK
D4 quick-actionOKQuick Actions finds the macro first for "html", "HTML" and the synonym "xhtml". "raw" lists Box, sequence and diagram, and "markup" is not a good synonym. For a technical macro whose name is its technical name, this is a good result. The French and German names are "HTML" too.
L1 consistencyOKcompared with velocity and groovy, which also take code as a mandatory text content: all three open the Edit Macro dialog from their Quick Action, with a required Content text area, and declare inline support. The wiki parameter defaults to false for html and to true for velocity and groovy, which is by design: the content of html is HTML, not wiki syntax.
L2 doc-parametersKOthe parameters are documented only on the legacy extensions.xwiki.org page, https://extensions.xwiki.org/xwiki/bin/view/Extension/HTML%20Macro, not in the new documentation. The legacy table matches the descriptor for clean and wiki.
L3 doc-exampleKOminor: both documentation examples show off the wiki parameter, {{html wiki="true"}}<table><tr><td>* listitem</td></tr></table>{{/html}} , or hold no HTML, {{html}}**some escaped text**{{/html}} ; none shows the plain use, inserting HTML markup, which is as frequent in XWiki itself. The audit uses the wiki="true" table as the most common example.
I1 patternOKcompared with the reference generator, children. The HTML Quick Action opens the Edit Macro dialog with an empty Content text area, and the macro needs its HTML to do anything, so the dialog is OK, like include and the script macros.
I2 zero-configOKthe Edit Macro dialog cannot be submitted with the default values, since the content is mandatory and empty: it stays open, with no message, the generic behavior of the dialog. An empty HTML macro has no sensible result, and {{html/}} written in the source renders nothing, with no error.
I3 instantN/AN/A for a generator. The Quick Action opens the Edit Macro dialog with an empty Content text area, see I1.
I4 cursorN/AN/A for a generator. After submitting the dialog, the macro widget is selected, and the content can only be changed through the dialog.
I5 focusOKthe content, the HTML, is the only mandatory parameter: the Edit Macro dialog shows its text area first, like the script macros, and every field is visible without scrolling.
E1 wysiwygOK
E2 errorsKOinvalid values are accepted silently, with no message. For example, {{html wiki="abc"}}<p>**bold**</p>{{/html}} is read as false and shows "bold", while {{html wiki="yes"}}<p>**bold**</p>{{/html}} is read as true; {{html clean="maybe"}}...{{/html}} is accepted the same way. Malformed HTML in the content is fixed by the cleaning, which is the purpose of the clean parameter, not an error.
E3 nestingKOin a list item and in a table cell, like * item {{html}}<table><tr><td>Cell</td></tr></table>{{/html}} , the macro is inline and renders "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.", in the editor and in view mode; the advice to leave empty lines cannot be applied in a list item. It renders only when wrapped in a group, * ((( {{html}}<table>...</table>{{/html}} ))) . Inside a box it renders, and with wiki="true" a list, a table and a box inside its content render.
E4 inline-supportOKthe macro declares inline support, and inline HTML renders inside a sentence, like The text is {{html}}<span style="color: red;">red <strong>HTML</strong></span>{{/html}} in a sentence. . Block HTML, like the table of the most common example, gives the explicit error quoted in E3 when used inline, which the HTML itself causes.
E5 emptyN/AN/A for a generator. An empty macro shows a visible "macro:html" placeholder that one click selects, and the content can only be typed in the Edit Macro dialog.
E6 inplaceN/AN/A for a generator. The HTML is still edited only in a plain text area of the Edit Macro dialog, with no HTML editing aid, also when editing an existing macro, which is worth an improvement outside the criteria.

Parameters

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

C4: a plain text area in the Edit Macro dialog, counted under E6.

cleanKOOKOKOKOKOKN/AOKOKN/A

C1: the description "Indicate if the HTML should be transformed into valid XHTML or not." uses a wrong term: since XWiki 14.1 the cleaning follows the HTML version of the rendering, HTML 5 by default, not XHTML. It also does not say that unchecking it has no effect without script right, see the Security section of the documentation. Shown in the Edit Macro dialog of {{html}}<p>Text</p>{{/html}} . The French name, "Effacer", means "erase".

wikiOKOKOKOKOKKON/AOKOKN/A

C3: the default, false, is preselected. The most common example sets wiki="true" only to show the parameter, and false is the right default for HTML content.

C6, minor: the most common example sets wiki, which comes after clean.

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
L2L2 doc-parametersXINFRA-525
L3L3 doc-exampleXINFRA-526
E2E2 errorsXCOMMONS-3847, XRENDERING-823
E3E3 nestingXWIKI-23501
C1:cleanC1 clarity, cleanXWIKI-25493
C6:wikiC6 order, wikiXRENDERING-825
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25493NewC1:clean
XRENDERING-825NewC6:wiki
XINFRA-525NewL2
XINFRA-526NewL3
XWIKI-23501ExistingE3

Known issues of this macro

IssueTitleStatusCriteria
XWIKI-19950Make the HTML macro editable inlineOpenE6

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

Get Connected