Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
8.2.1
-
None
-
Unknown
-
Description
Repro:
- Write this source content into Sandbox.InnerFoo.WebHome:
paragraph 1 inside InnerFoo paragraph 2 inside InnerFoo
- Write this source content into Sandbox.OuterFoo.WebHome:
inline test before {{display reference="Sandbox.InnerFoo.WebHome"/}} and after
- Observe that the content gets rendered as multiple paragraphs. Even though display was used in an inline context, because InnerFoo contains paragraphs, all of the rendered content gets broken up into individual paragraphs ("de-inlined").
- Edit Sandbox.OuterFoo.WebHome in CKEditor. Observe that the actual content of InnerFoo "spills out" into the editor. Look at the Source view: the actual contents of InnerFoo have become part of the source content of OuterFoo. You can also just directly Save the page without going to Source view and observe that OuterFoo now contains the literal contents of InnerFoo (in addition to the original display macro). You can repeat the Save repeatedly and each time you'll get another copy of InnerFoo cloned into OuterFoo.
- Edit Sandbox.OuterFoo.WebHome in the old WYSIWYG editor. Observe that making any edit to the content in the WYSIWYG editor, such as inserting a space anywhere, causes "(((" to get injected into the Source content view of the editor after the display macro's position.
In short there is a major disconnect occurring when block content gets injected into a page in an inline context. This impacts both display and include macros.
The potential user impact is serious, since any page that utilizes one of these kinds of macros runs the risk of inadvertently and silently corrupting the calling page's content every time they save the page from the editor.
The trivial fix is to simply prevent users from injecting block content when in an inline context, by throwing an exception and requiring the user to adjust their XWiki markup accordingly. This is the approach that the html macro currently utilizes.
However, from a user perspective this solution is not ideal. Ideally a user can place a macro anywhere in a page (inline or block context), and XWiki should just do the right thing. In the case of block content being injected into an inline context, it would be best if XWiki could just "de-inline" the context surrounding the block-content injection point. In other words, the rendering behavior as described in step #3 is ideal, but the adverse behavior seen in steps #4/5 should be properly mitigated by XWiki without any specific user intervention.
Attachments
Issue Links
- depends on
-
XRENDERING-517 Invalid HTML generated when a macro that is called inline produces block level content
- Open
- is duplicated by
-
XWIKI-20192 Display macro added twice copy content of the entity in the current page
- Closed
-
XWIKI-13996 The Display Macro generates invalid HTML when used in-line
- Closed
-
XWIKI-22715 Include and Display macros shouldn't duplicate the content of multiline content when used inline
- Closed
- relates to
-
XRENDERING-662 Include macro displays the included content in addition to the macro block when preceded by simple text without empty line
- Closed
-
XRENDERING-745 Impossible to save page with specific source code in CKEditor or WYSIWYG editor
- Closed
-
XWIKI-21125 Include and Display macros should generate inline content when used in an inline context
- Closed