On Thu, Jan 14, 2010 at 11:53, Marius Dumitru Florea <[email protected]> wrote: > Andreas Jonsson wrote: >> Hello Marius, >> >> Marius Dumitru Florea wrote: >>> Hi Andreas, >>> >>> Andreas Jonsson wrote: >>> >>>> Andreas Jonsson wrote: >>>> >>>>> Hello, >>>>> >>>>> I'm still digging into the XWiki grammar file and noticed another odd >>>>> thing. Wiki parameters at the beginning of a line terminates a >>>>> block. Compare these two examples: >>>>> >>>>> | table cell >>>>> (% style="color: blue;" %) >>>>> new paragraph >>>>> >>>>> | table cell >>>>> (% style="color: blue;" %) >>>>> >>>> There was supposed to be a space at the beginning of the above line. >>>> The examples again: >>>> >>>> | table cell >>>> (% style="color: blue;" %) >>>> new paragraph >>>> >>>> | table cell >>>> (% style="color: blue;" %) >>>> continuing table cell >>>> >>>> >>>>> continuing table cell >>>>> >>>>> >>> >>>>> Is this intentional? >>>>> >>> Yes, I think it is. When parameters follow a new line they are applied >>> to the next block. As a consequence they mark the beginning of a new >>> block. Otherwise the parameters are applied in-line till the block ends >>> or they are stopped by (%%). >>> >>> This way we can have: >>> >>> (% style="color:red" %) >>> Paragraph with red text containing a (% style="background-color:yellow" >>> %)highlighted(%%) word. >>> >>> Hope this helps, >>> Marius >>> >> >> Yes, parameters may be applied either on a block or inline, but >> to be applied to a block there must also be a newline after the >> parameters. In other words, parameters before a block are applied to a >> block, parameters inside a block are applied inline. This is >> expected. >> >> But I was suprised by the fact that parameters at the beginning >> of a line terminates a block, and this regardless of wheter they >> are inline to the following block or not. >> >> For example: >> >> | table cell >> (% style="color: blue;" %) >> new paragraph >> >> results in: >> >> <p style="color: blue;">new paragraph</p> >> >> i.e., parameters applied to the block, whereas in the following >> example: >> >> | table cell >> (% style="color: blue;" %) new >> paragraph >> >> you'll get: >> >> <p><span style="color: blue;"> new<br/>paragraph</span></p> >> >> i.e., parameters are applied inline. But still a new block. >> >> I would have guessed that a block should be terminated by an >> empty line. > > Indeed, if I write: > > -----8<----- > before > > abc > xyz > > after > ----->8----- > > I get 3 paragraphs, while if I write: > > -----8<----- > before > > abc > (% style="color:red;" %) > xyz > > after > ----->8----- > > I get 4. I wasn't aware of this.
Indeed the second one looks like a bug to me, the (% style="color:red;" %) should not break the paragraph. > > Thanks, > Marius > >> >> Best regards, >> >> Andreas >> _______________________________________________ >> devs mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/devs > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

