On Oct 6, 2009, at 5:15 PM, Marius Dumitru Florea wrote:
Hi Lewis,
Lewis Denizen wrote:
Hi xwiki-users,
One small quirck with the 2.0 release - when I try something like
this:
{{box title="{{info}}test{{/info}}"}}this is a test{{/box}}
the output becomes a bit screwey... Parts of the {{info}} tag gets
added to
the content of the box instead of into the title. It does work
when the
{{info}} is escaped properly:
{{box title="~{~{info~}~}test~{~{/info~}~}"}}this is a test{{/box}}
but the WYSIWYG editor doesn't escape these (and it would make
things look a
bit nicer if we didn't have to escape on properly-quoted
parameters.. with
the obvious exception of a double-quote inside a quoted-
parameter :-)).
So... what should the right behavior be?
IMO there shouldn't be any need for escaping the { and } inside a
parameter value. It seems the XWiki 2.0 parser stops reading the
parameter value when it encounters }} which I think it's a bug.
Thomas should know more about it.
This is voluntary right now. Here's the grammar:
| <#MACRO_NAME: (<XWIKI_CHAR>)+ (["-", "_",
".", ":"]
(<XWIKI_CHAR>)+)* >
| <#MACRO_PARAMS: ( "~" ~[] | ~["}"] | "}"
~["}"] )* >
| <#MACRO_EMPTY: "{{" <MACRO_NAME> ((<SPACE>)
<MACRO_PARAMS>)?
"/}}" >
| <#MACRO_START: "{{" <MACRO_NAME> ((<SPACE>)
<MACRO_PARAMS>)?
"}}" >
| <#MACRO_END: "{{/" <MACRO_NAME> (<SPACE>)* "}}"
>
| <#MACRO_CONTENT: ( <XWIKI_CHAR> | <SPACE> |<NEW_LINE> |
<XWIKI_SPECIAL_SYMBOL> ) >
So }} is not allowed in a macro parameter. Otherwise there would be a
pb to know which "}}" correspond to the macro end (it would be harder).
There is no official rule to forbid }} in macro parameters, we just
did not tough of that IMO. From pure syntax POV we should support it
IMO the same way we support it in macro content.