On Sat, 23 Feb 2002, Jeremy Quinn wrote:
> >BTW, your new slash-edit demo is really nice. By crossing this with the
> >Chaperon text parser and the "crushing userland" thread, we should
> >quickly have a Cocoon-powered weblog !
>
> Ah Ha! It works ... great news!
>
> The Chaperon text parser, can it take paragraphs of text and convert it to XML?
I think yes.
> The user writes something like this in a form field:
>
>
> Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
> doming id quod mazim placerat facer possim assum.
>
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
> nibh euismod
>
> Tincidunt ut laoreet
> Dolore magna aliquam
> Erat volutpat
>
> Which is turned into something like this:
>
> <p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
> doming id quod mazim placerat facer possim assum. </p>
>
> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
> nonummy nibh euismod</p>
>
> <p>Tincidunt ut laoreet<br/>
> Dolore magna aliquam<br/>
> Erat volutpat</p>
>
> Can it do this?
>
> This would avoid much of the need to let the user edit XML at all, and save
> everybody a lot of grief!
#token WORD [A-Za-z]+;
#token CR \r;
#whitespace [\ \t\n]+
%%
linecontent : line WORD %append
| WORD %append
;
line : linecontent CR
;
emptyline : CR
;
paragraphcontent : paragraphcontent line %append
| line %append
;
paragraph : paragraphcontent emptyline
;
text : text paragraph %append
| paragraph %append
;
Something like this should work, and chaperon will produce
<text>
<paragraph>
<line>
<WORD>Nam</WORD><WORD>liber</WORD>
[...]
At this moment, we write in our group a latex grammar, with which
author could write latex(inclusive mathematical content) in a webform.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]