Vincent Massol wrote:
> On Apr 9, 2010, at 2:54 PM, Andreas Jonsson wrote:
>
>
>> Vincent Massol wrote:
>>
>>> On Apr 9, 2010, at 2:14 PM, Andreas Jonsson wrote:
>>>
>>>
>>>
>>>> Hi,
>>>>
>>>> I prefer a solution where the end token is changed rather than
>>>> the content. Look at the embedded parser construction in
>>>> MoinMoin syntax for an example.
>>>>
>>>> I instead propose to introduce an instruction to the parser in
>>>> the start-tag to expect a different end token. Something like:
>>>>
>>>> {{foo #endtag:foobar}}
>>>> content
>>>> {{/foo}}
>>>> still content
>>>> {{/foobar}}
>>>>
>>>>
>>> Not a bad idea. It would be backward compatible too.
>>>
>>>
>>>
>>>> For verbatim we could use the same technique as MoinMoin, either:
>>>>
>>>> {{{{
>>>> content
>>>> }}}
>>>> more content
>>>> }}}}
>>>>
>>>> or:
>>>>
>>>> {{{arbitrarystringofalphanumerics
>>>> content
>>>> }}}
>>>> more content
>>>> arbitrarystringofalphanumerics}}}
>>>>
>>>>
>>> This would change our syntax since right now we can write: {{{hello}}}
>>>
>>> Your solution would loose the ability to have inline verbatim.
>>>
>>>
>> I am not proposing that this style is used for inlined verbatim only for
>> blocks. So the start token is only a start token if it stands on a line
>> by itself outside of any pargraph.
>>
>
> So what would be your solution for inline verbatim (i.e. to be able to write:
> {{{...}}}...}}})?
I didn't think that there was a need to have a solution for this inline
(MoinMoin doesn't either, although the inlined variant of {{{}}} also have
completely different semantic from the block version in MoinMoin). But on
second thought, we should maybe use something that is consistent with wathever
the syntax for macros would be. So maybe instead:
{{{#endstring:foo content }}} more content foo}}}
Best regards,
Andreas Jonsson
> Thanks
> -Vincent
>
>
>> Best regards,
>>
>> Andreas Jonsson
>>
>>> Thanks
>>> -Vincent
>>>
>>>
>>>
>>>> Best regards,
>>>>
>>>> Andreas Jonsson
>>>>
>>>>
>>>> Thomas Mortagne wrote:
>>>>
>>>>
>>>>> 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
>>>>>
>>>>>
>>> _______________________________________________
>>> devs mailing list
>>> [email protected]
>>> http://lists.xwiki.org/mailman/listinfo/devs
>>>
>>>
>>>
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs