On Dec 16, 2008, at 9:04 PM, Vincent Massol wrote:

>
> On Dec 16, 2008, at 8:48 PM, Thomas Mortagne wrote:
>
>> Hi devs,
>>
>> We have an issue in the XWiki renderer when the XDOM contains a bold
>> starting with a space at the beginning of a line. For example when we
>> get an html containing <p><strong>&nbsp;some bold text</strong></p>  
>> in
>> the office importer.
>>
>> In that case currently we lost the bold when rendering because one or
>> more stars followed by a space is a list in XWiki syntax.
>>
>> I see two solutions:
>>
>> 1) Escape the first space in a verbatim block : **{{{<space>}}}some
>> bold text**
>> 2) Move the first spaces before the bold block: <space>**some bold
>> text**
>> 3) Remove all the first spaces of the bold block: **some bold text**
>>
>> I would prefer 1) because it's the only one which is really the same
>> thing than the input but I think 2) is better for most users because
>> it's less disturbing for something which is not really that  
>> important.
>> I listed 3) because it's easier to implement than 2).
>>
>> WDYT ?
>>
>> Here is my +1 for 2) and +0 for 1) and 3)
>
> I'd prefer 4)... :)
>
> Which could be:
>
> **~(space)whatever**
>
> This is possible I think by changing XWikiScanner.jj in wikimodel to:
>
>       <#LI: (<XWIKI_SPACE>)* ( ("*")+ (":" | ";")* | ( "1" | "*" )+
> "." (":" | ";")* | (":" | ";")+ ) (<SPACE>)+ >
>
> Note the <SPACE> instead of <XWIKI_SPACE>.

Just to be clear the escape char is there to break standard behaviors  
so having:

~(space)**bold**

or

**~(space)bold**

makes sense to me.

Same for headers:

~(space)= not a header

And possibly same for other elements which recognize spaces. This is  
very similar to using an escape in ~**notbold

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

Reply via email to