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
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 a lot 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
|