This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-5b8ceade-2c39-4bf0-9c19-ca4263c8bcb0 XWIKI-23471 Open

HTML structure code is displayed in Wiki editor

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-56024799-f022-4bda-9faf-a27e431206de Nikita Petrenko created this issue on 19/Aug/25 15:57
 
Summary: HTML structure code is displayed in Wiki editor
Issue Type: cid:jira-generated-image-avatar-5b8ceade-2c39-4bf0-9c19-ca4263c8bcb0 Bug
Affects Versions: 17.7.0-rc-1
Assignee: Unassigned
Components: CKEditor, WYSIWYG Editor
Created: 19/Aug/25 15:57
Environment: XWiki 17.7.0-RC with PostgreSQL on Tomcat 10.1.34
Priority: cid:jira-generated-image-static-major-77fbe0ba-6a29-4a30-9415-b8aa6f8744eb Major
Reporter: Nikita Petrenko
Description:

Steps to reproduce:

  1. Trigger editing of any test wiki pages in WYSIWYG editor
  2. Switch to source code and paste code
    [[
    
    {{info}}Type your information message here.{{/info}}>>https://www.xwiki.org/xwiki/bin/view/Main/]]
    
  3. Return to WYSIWYG editor and switch to source mode and back several times

Actual result

At somepoint on random switch to source mode, you will see the HTML code instead of the macro syntax, and you may end up saving the page with that content.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><body><p><!--startwikilink:false|-|url|-|https://www.xwiki.org/xwiki/bin/view/Main/--><span class="wikiexternallink"><a href="https://www.xwiki.org/xwiki/bin/view/Main/"><!--startmacro:info|-||-|Type your information message here.--><!--stopmacro--></a></span><!--stopwikilink--></p><div class="box infomessage"><a href="https://www.xwiki.org/xwiki/bin/view/Main/"><span class="sr-only">Information</span></a><div><p><a href="https://www.xwiki.org/xwiki/bin/view/Main/"><span data-xwiki-non-generated-content="java.util.List&lt;org.xwiki.rendering.block.Block&gt;" class="xwiki-metadata-container">Type your information message here.</span></a></p></div></div><!--stopmacro--><!--stopwikilink--><p>&nbsp;</p></body></html>

Expected result

The source code is loaded properly on switching between WYSIWYG and Wiki mode

Note

And it seems that it can only be reproduced if the macro is filled in incorrectly (some parameters are missing or something else). I can't end with HTML structure code if I define any XWiki macro correctly in wiki mode or insert it from WYSIWYG toolbar.