A misplaced style statement confuses WYSIWYG editor

If a style statement is misplaced the WYSIWYG editor may be confused: It does not accept any change of the document

Example:

{{box}}
|=N |=Double |=Triple
| 1 | 2      | 3 
| 2 | 4      | 6
{{/box}}

(% style="width:60%" %)
{{box}}
|=N |=Double |=Triple
| 3 |  6     |  9 
| 4 |  8     | 12
{{/box}}

If you change (WYSIWYG) any table element of the second and the first (!) table the change will not accepted!

The box macro is only used as an example. It happens with any macro that use {{xwikimacrocontent /}} with WIKI content.

An additional remark:
If you request “source code” within the WYSIWYG editor HTML code returns!

XWiki Version: 11.10.10

It is easy to avoid - use a set of ((( ))), but the effect was astonishing and it required a bit of research.

Greetings

Norbert

The wiki syntax you use doesn’t have the behavior you expect and that’s visible in view mode, without involving the WYSIWYG editor. The styles applied to the box macro makes it be rendered as an inline macro which leads to invalid HTML:

<div class="box">
  <table><tr><th scope="col">N&nbsp;</th><th scope="col">Double&nbsp;</th><th scope="col">Triple</th></tr><tr><td>&nbsp;1&nbsp;</td><td>&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;3&nbsp;</td></tr><tr><td>&nbsp;2&nbsp;</td><td>&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;6</td></tr></table>
</div>

<p style="width:60%">
  <span class="box">
    <table><tr><th scope="col">N&nbsp;</th><th scope="col">Double&nbsp;</th><th scope="col">Triple</th></tr><tr><td>&nbsp;3&nbsp;</td><td>&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;&nbsp;9&nbsp;</td></tr><tr><td>&nbsp;4&nbsp;</td><td>&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;12</td></tr></table>
  </span>
</p>

You have a table inside a span. The forces the browse to fix the HTML which breaks the macro output protected in the WYSIWYG editor.

Thanks @NorSch .Right now we don’t perform XDOM validation nor ensure that the generated HTML is valid. We have issues for this: