Seems like I opened a can of worms :-S

Logged a JIRA for tracking: http://jira.xwiki.org/jira/browse/XWIKI-4457

I'll try to beautify the ticket once I get access to a PC instead of  
an iPhone ;-)

Thanks for looking into this!


On Oct 7, 2009, at 1:49 AM, Thomas Mortagne  
<thomas.morta...@xwiki.com> wrote:

> 2009/10/6 Marius Dumitru Florea <mariusdumitru.flo...@xwiki.com>:
>> Thomas Mortagne wrote:
>>> 2009/10/6 Vincent Massol <vinc...@massol.net>:
>>>> 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.
>>
>> I agree. Otherwise the WYSIWYG editor needs to escape the }} in macro
>> parameters.
>
> The WYSIWYG can't do that since it does not know xwiki/2.0 escaping  
> syntax.
>
>>
>> Thanks,
>> Marius
>>
>>>
>>>> BTW you only need to escape one "}" to make it work fine ;)
>>>>
>>>> Note that quotes for macro values are optional right now and this  
>>>> is
>>>> the reason macro params are checked for }}.
>>>
>>> We could support it, it's not a good reason. It's not a big  
>>> difference
>>> to support with or without the quotes. The hard part is the refactor
>>> needed to actually parse the macro parameters in javacc directly
>>> instead of after the javacc pass.
>>>
>>>> We could decide that quotes are mandatory but it's a pretty big  
>>>> change
>>>
>>> -1 for that, i'm pretty sure most of the users don't use the quotes.
>>> It would just be more pain for the user. It's a wiki syntax not  
>>> hidden
>>> serialization format.
>>>
>>>> (would be for Syntax 2.1) and I don't think it's a good idea since
>>>> this your use case is pretty rare. And btw I still don't know if
>>>> accepting wiki syntax in parameters is a good thing or not.
>>>>
>>>> Thanks
>>>> -Vincent
>>>>
>>>>> Thanks,
>>>>> Marius
>>>>>
>>>>>> -- Lewis
>>>> _______________________________________________
>>>> users mailing list
>>>> users@xwiki.org
>>>> http://lists.xwiki.org/mailman/listinfo/users
>>>>
>>>
>>>
>>>
>> _______________________________________________
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
>
>
> -- 
> Thomas Mortagne
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to