There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-03a7e34a-494c-4bc2-9d72-476c120413c9 XWIKI-23501 Open

Block macros are broken in tables and lists

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-03c81519-8d99-48f0-8a82-152db6d820d6 Marius Dumitru Florea on 18/Sep/25 10:58
 

The WYSIWYG editor is, theoretically, not supposed to generate content for a specific wiki syntax. Other syntaxes, or future XWiki syntax versions, may support block level content inside list items and table cells. Currently, the only way we can adjust the WYSIWYG editor output to match the source syntax is through a configuration that says which HTML elements are allowed in which context (parent HTML element). We can use this to forbid block level content inside list items and table cells, but this would forbid groups (DIVs) a well. If we allow DIVs (besides inline content) then we allow block level macros as well, which are wrapped in a DIV. Rendering syntax groups have no special marker, so there's no simple way to say "the only block level content allowed is a group". But even if we had this, the fact that groups are allowed doesn't mean they are inserted automatically. This can't be done through configuration. And if we make the WYSIWYG editor do it then it becomes bound to a specific source syntax (we may have issues with other syntaxes).

On the WYSIWYG side, it's not complex to wrap the inserted macro in a DIV (group) in some conditions (e.g. when you are alone inside a table cell or list item) but it doesn't feel right to have this logic inside the WYSIWYG editor.