There is 1 comment.
 
 
Markdown Syntax / cid:jira-generated-image-avatar-622df366-e6b5-4ae5-92cb-722d06965df4 MARKDOWN-56 Closed

Add support for Group syntax

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-caecf42a-3f1a-4c75-adc9-866ab459d543 Vincent Massol on 28/Sep/26 13:47
 

Update: following the forum discussion, the data-xwiki-group marker attribute described in my previous comment has been dropped (see https://github.com/xwiki-contrib/syntax-markdown/pull/8). A Group is now written as a plain <div>, the same way the HTML parser converts a <div> into a Group:

<div class="box infomessage">

This is an **info** box.

</div>

The opening and closing tags must still be alone on their line and surrounded by blank lines (in CommonMark, an HTML block starting with <div only ends at a blank line, so without it the content wouldn't be parsed as Markdown).

Changes for existing content that already contains such {{<div>}}s (they were html macros before, they're Groups now):

  • The HTML output is unchanged for authors with script right, and fixed for authors without script right (the restricted cleaning of the 2 separate html macros produced an empty <div>, with the content outside of it).
  • Headings inside such a <div> are no longer section-editable (same as for (((...))) in XWiki Syntax 2.1).
  • Event handler attributes (e.g. onclick) are neutralized by the XHTML renderer's sanitizer, even for authors with script right.

A <div> that is not alone in its HTML block (e.g. <div>text</div>), that has invalid attributes, or that is unbalanced, is still converted to an html macro. The other caveats from my previous comment (parameterless Groups, Groups inside paragraphs and table cells, escaping) still apply.