Hi devs,

We have a limitation in the xwiki/2.0 parser related to the way macros
are parsed: impossible to have the ending syntax of a macro as content
of this macro.

Here is the related jira issue: http://jira.xwiki.org/jira/browse/XWIKI-5077

A good example is: i want to have "{{/code}}" alone as the content of
a code macro. That's impossible.

The only way to have {{/code}} in the content is with:

{{code}}
{{code}}
{{/code}}
{{/code}}

or

{{code}}
~{{/code}}
{{/code}}

but in the first case you get "{{code}}" you did not want and in the
second you get "~" you did not want.

Only solution i can see is to specifically handle escaping of ending
macro syntax inside macros of the same name.

Here is some examples:

1)

{{code}}
~{{/code}}
{{/code}}

would give code macro containing "{{/code}}"

2)

{{code}}
~{{/somemacro}}
{{/code}}

would give code macro containing "~{{/somemacro}}"

3)

{{code}}
~~{{/code}}
{{/code}}

would give code macro containing "~" followed by the text "{{/code}}"

4)

{{code}}
~~~{{/code}}
{{/code}}

would give code macro containing "~{{/code}}"

5)

Then double escaping for each level to escape:

{{box}}
{{box}}
~~~{{/box}}
{{/box}}
{{/box}}

would give box macro containing a box macro containing the text
"{{/box}}": the first pass change "~~~{{/box}}" into "~{{/box}}" like
in example 4) and the second pass escape "{{/box}}" like in example
1).

So WDYT ?

Here is my +1

-- 
Thomas Mortagne
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to