This issue has been created
 
 
Confluence / cid:jira-generated-image-avatar-f6b341aa-531a-48d0-9a39-8f235ff5e722 CONFLUENCE-368 Open

Macros inside list and task body tags are always imported as inline

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3daa6e63-49f3-49d6-9c2c-ca6da4c54111 Teodor Caras created this issue on 15/Jan/25 11:50
 
Summary: Macros inside list and task body tags are always imported as inline
Issue Type: cid:jira-generated-image-avatar-f6b341aa-531a-48d0-9a39-8f235ff5e722 Bug
Affects Versions: 9.71.0
Assignee: Unassigned
Components: Syntax - XHTML
Created: 15/Jan/25 11:50
Priority: cid:jira-generated-image-static-major-2ea4d5ee-9f51-47cb-99a9-d83e5db107c8 Major
Reporter: Teodor Caras
Description:

Content such as this

 

<ul>
    <li>
    <p>Add a RACF resource in the SERVAUTH class as follows:</p>
    <ac:structured-macro ac:name="code" ac:schema-version="1"
        ac:macro-id="f96ac0fc-1fb2-4f02-8494-f64d1bd3e2cc">
        <ac:parameter ac:name="language">text</ac:parameter>
        <ac:plain-text-body><![CDATA[EZB.NETMGMT.sysname.tcpprocname.SYSTCPCN EZB.NETMGMT.sysname.tcpprocname.SYSTCPSM EZB.NETMGMT.sysname.tcpprocname.SYSTCPOT]]></ac:plain-text-body>
    </ac:structured-macro>
    <p>where:</p>
    </li>
</ul>

Trimmed as

 

<ul>
  <li>
    <p>Something</p>
    <ac:structured-macro ac:name="macroName" />
    <p>Something</p>
  </li>
</ul>

Will be imported as

 

 

* (((
Something

{{macroName/}}Something
))) 

Expected

* (((
Something

{{macroName/}}

Something
))) 

This is caused by the line: https://github.com/xwiki-contrib/confluence/blob/514b45ed410f769bd61ab15dbbd201c91f5a1139/confluence-syntax-xhtml/src/main/java/org/xwiki/contrib/confluence/parser/xhtml/internal/wikimodel/MacroTagHandler.java#L112

Im not sure how we could fix this, since content such as this

<ul>
  <li>
    Something
    <ac:structured-macro ac:name="macroName" />
    Something
  </li>
</ul>
 

Should indeed mark the macro as inline. However, im not sure how often we encounter each scenario.