This issue has been created
 
 
XWiki Rendering / cid:jira-generated-image-avatar-3d0a6799-3cd0-4487-8bc1-bf8d2b674d1e XRENDERING-754 Open

Invalid HTML is generated when saving page after copy and paste row with mentioned macro and text into row of the table

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-2c7ffe7e-be6f-449b-9375-f3790c515f13 Nikita Petrenko created this issue on 02/Aug/24 15:26
 
Summary: Invalid HTML is generated when saving page after copy and paste row with mentioned macro and text into row of the table
Issue Type: cid:jira-generated-image-avatar-3d0a6799-3cd0-4487-8bc1-bf8d2b674d1e Bug
Assignee: Unassigned
Components: Syntax - xhtml/1.0 & html/4.01, Syntax - xwiki/2.1
Created: 02/Aug/24 15:26
Priority: cid:jira-generated-image-static-major-7a36061b-b51d-4006-8902-d5d44dd7b2d5 Major
Reporter: Nikita Petrenko
Description:

After following steps from XRENDERING-753, the WYSIWYG editor generates a velocity code inside HTML.

<table><tbody><tr><td>&nbsp;</td><td><!--startmacro:mention|-|reference="XWiki.npetrenko" style="FULL_NAME" anchor="XWiki-npetrenko-vmfpml"--><!--stopmacro--></td><td>Here is some Text</td></tr><tr><td>&nbsp;</td><td><span tabindex="-1" contenteditable="false"><span data-macro="startmacro:mention|-|reference=&quot;XWiki.npetrenko&quot; style=&quot;FULL_NAME&quot; anchor=&quot;XWiki-npetrenko-vmfpml&quot;" data-widget="xwiki-macro" data-xwiki-dom-updated="true" class="macro"><span class="hidden macro-placeholder">macro:mention</span><span data-macro="startmacro:velocity|-||-|#set ($reference = $wikimacro.parameters.reference)
    #set ($style = $wikimacro.parameters.style)
    #set ($type = &quot;$!wikimacro.parameters.type&quot;)
    #set ($content = $services.mentions.format($reference.reference, $style, $type))
    #set ($anchor = $wikimacro.parameters.anchor)
    #set ($isCurrentUser = $xcontext.userReference == $reference.reference &amp;&amp; ($type == '' || $type  == 'user'))
    #set ($cssClasses = ['xwiki-mention', 'user'])
    #if ($isCurrentUser)
      #set ($discard = $cssClasses.add('self'))
    #end
    #set ($link = $xwiki.getURL($reference.reference, 'view'))
    \{\{html}}
    &lt;\a id=&quot;$escapetool.xml($anchor)&quot; class=&quot;$stringtool.join($cssClasses, ' ')&quot; data-reference=&quot;$escapetool.xml($services.model.serialize($reference.reference, 'default'))&quot; href=&quot;$escapetool.xml($link)&quot;&gt;##
      $escapetool.xml($content)## Do not remove this comment as it ensures that the spacing after mention is not broken.
    &lt;\/a&gt;
    \{\{/html}}" class="macro"><span class="hidden macro-placeholder">macro:velocity</span><span data-macro="startmacro:html|-||-|&lt;\a id=&quot;XWiki-npetrenko-vmfpml&quot; class=&quot;xwiki-mention user self&quot; data-reference=&quot;xwiki:XWiki.npetrenko&quot; href=&quot;/xwiki/bin/view/XWiki/npetrenko&quot;&gt;@Nikita Petrenko&lt;\/a&gt;" class="macro"><span class="hidden macro-placeholder">macro:html</span><!--startwikilink:xwiki:XWiki.npetrenko--><span class="wikilink"><a id="XWiki-npetrenko-vmfpml" class="xwiki-mention user self" href="/xwiki/bin/view/XWiki/npetrenko">@Nikita Petrenko</a></span><!--stopwikilink--></span></span></span></span></td><td>Here is some Text</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table>