Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Rendering in the platform
-
None
-
Unknown
-
Description
When a MacroBlock has " ~ " as content, the xwiki/2.x render does not do anything specific about that ~. For example, an info macro with content " ~ " will be serialized as:
{{info}}~{{/info}}
The problem is that " ~ " being an escaping character, the content above is actually the macro info with content
~{{/info}}
We need to make sure to properly protect the end macro from the ~.
The difficulty is that in xwiki/2.1 the ~ is not consumed when it's used to escape something which is located in a macro. So doubling the ~~ protects the end macro, but you will actually have ~~ in that macro content. This is something that should ideally be fixed in a xwiki/2.2 syntax, but in the meantime we need to decide the least bad option to stop breaking end macros:
- escape with ~ despite the problem described above: at least it will behave as expected when the macro contains wiki syntax
- add an extra white space after the infamous ~: it's not more valid, but at least the hack is less visible for a human
- a mix:
- when the Macro indicates that the content type is wiki syntax, escape using ~
- when we don't know the content type, add an extra white space
Whatever solution, a slightly bad escaping is better that completely breaking the macro...
Attachments
Issue Links
- is related to
-
XRENDERING-13 Impossible to have ending code macro syntax in a code macro when there is no starting code macro before
- Open