figureCaption

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

Audit

Macro ID
figureCaption
Source
Figure Macro
Type
Wrapper
Classification reason

Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-20
Auditor
Compared macros
figure footnote

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/Figure/Figure%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-contrib/figure/blob/figure-15.4.5/figure-macro/src/main/java/org/xwiki/contrib/figure/internal/FigureCaptionMacro.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, D3figure, footnote
Other sources specific to this macro
  • Figure audit: the figure that holds the caption, audited on its own page.
  • FigureCaptionMacro.java: the name, the description and the content description are hard-coded English strings; the caption must be the first or last block of a block figure.
  • Translations of the extension: only the type parameter and the figure types have keys.
CriterionResultNotes
D1 wordingOK
D2 summaryKOminor: "Provide a figure caption when used inside the Figure macro." repeats the name and only adds where the macro goes. It does not say where the caption is shown, below or above the content of the figure, nor that it must be the first or last element of the figure.
D3 categoryKOthe macro is in the Development category, like figure, while a user looking for a way to caption an image or a table would look in Layout or Content, as noted for figure.
D4 quick-actionKOQuick Actions finds the macro first for "figureCaption", "Figure Caption", "caption" and "image caption". The synonyms "legend", "figure title" and "table caption" give no result. The macro name and description are not translated: French and German show "Figure Caption" and the English description, so no other language finds the macro with a different word, like figure.
L1 consistencyOKcompared with figure and footnote. Like footnote, the content is mandatory with no default and typed in the dialog from the Quick Action, which is by design since an empty caption gives nothing to show. Figure has an optional content and is inserted directly.
L2 doc-parametersKOthe macro is documented only on the legacy extensions.xwiki.org Figure Macro page, with no page in the new documentation. Its parameter table lists only type, which is a parameter of figure: the content of the caption is not documented. Its Usage examples show the caption.
L3 doc-exampleOKthe documentation shows the caption first and last in a figure, with an image, a table and a lemma, and these examples render. The first examples use placeholder text, "...caption content here".
I1 patternKOthe reference wrapper, warning, is inserted by its Quick Action without a dialog. The Figure Caption Quick Action opens the Edit Macro dialog, see I3, the generic behavior of macros without a dedicated Quick Action, like footnote. Nothing in the editor tells that the macro only works inside a figure: it is inserted anywhere and renders "The figure caption must be located inside a figure macro." there.
I2 zero-configOK
I3 instantKOinserting from the Quick Actions menu with "/figure caption" and Enter opens the Edit Macro dialog with an empty Content text area, the only field; the macro is only inserted after typing a text and submitting.
I4 cursorKOafter submitting the dialog, the macro widget is selected and the cursor is not in its content: text typed right away goes nowhere.
I5 focusN/Athe only parameter is the mandatory content, shown at the top of the dialog without scrolling.
E1 wysiwygOKthe editor shows the caption as a plain paragraph under the table, like view mode, also after saving and reopening the page. Nothing marks it as a caption: its widget is only labeled "macro:figureCaption widget" for assistive technologies, and no placeholder says what it is. It is recorded OK like the other wrappers whose content is edited in place, but a user cannot tell the caption from a paragraph.
E2 errorsN/Athe macro has no parameter and accepts any text as content, so there is no invalid value to test. A caption that is neither the first nor the last element of the figure gives a clear error in view mode: "The figure caption must be the first or last element of the figure."
E3 nestingKOthe caption works with bold text, a link, several paragraphs, a list, a table and a box in its content, inside a figure, in view mode and in the editor. The whole figure with its caption renders in a box, but in a list item and in a table cell the figure renders "The [figure] macro is a standalone macro and it cannot be used inline." as noted for figure, and a caption alone there renders the figure caption error. The KO is shared with figure.
E4 inline-supportOKthe macro does not support the inline mode and renders an error block inside the sentence when used inline, which is expected since a figure is a block.
E5 emptyOKafter emptying the content, the area keeps a visible height, one click enters it and the text typed goes into the caption. An empty caption saves and renders no error.
E6 inplaceKOthe content is edited in place, but the Edit Macro dialog of an existing caption still shows it as a wiki syntax text area, like figure and box.

Parameters

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

C1, minor: the description "Caption content" only repeats the name of the parameter. It does not say that the content is shown as the caption of the figure, nor that it accepts wiki syntax and blocks like lists and tables.

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
D2D2 summaryXFIGURE-7
D3D3 categoryXFIGURE-7
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXINFRA-525
I1I1 patternXWIKI-25563
I3I3 instantXWIKI-25563
I4I4 cursorXWIKI-25569
E3E3 nestingXWIKI-23501
E6E6 inplaceXWIKI-25443
C1:$contentC1 clarity, $contentXFIGURE-7
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-23501ExistingE3
XWIKI-25443NewE6
XWIKI-25444NewD4
XFIGURE-7NewC1:$content D2 D3
XINFRA-525NewL2
XWIKI-25563NewI1 I3
XWIKI-25569NewI4

Known issues of this macro

No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.

Get Connected