[squeak-dev] swiki source suited to recent Squeaks

tim Rowledge tim at rowledge.org
Tue Aug 13 20:45:50 UTC 2019


Well, here's a weird thing that I don't recall ever coming up against before.

I've got a basic swiki page component for Seaside, as previously mentioned. Now we have Levente's (original plus small fixes) parser/generator to convert swiki markup to html. I join them together to see what happens ... and weird stuff happens. Testing in a workspace is fine BUT not when getting text back from a browser.

It turns out that the browser (safari and chrome) sends a string with CRLF line ends to us. Now, I'm a long way from keeping up to date with web stuff but really?  I thought we got LFs because unixy-things.

The practical issue is that the grammar provided in PEGParser class>>#grammarWiki has a load of places reliant on \n and so, for example, the Preformatted & Code tags simply get ignored.

Two obvious questions come to mind here
a) what on earth? CRLF? Is that normal or is it an artefact of some Seaside setup I can change?
b) if we need to change the grammar to cope with crlf, what is the best way? I don't find the grammar terribly intuitable and can't spot any rule explanation. I've tried changing the Preformatted rule for example to 
Preformatted <- "---\r\n" .{"---\r\n"} 
and the parser doesn't even recognise the swiki tags.

I'd hate to have to do a crlf -> lf conversion every time, it seems so inelegant.

Oh - http://code.google.com/p/support/wiki/WikiSyntax (as referenced in #grammarWiki) seems to be a dead page now, which makes it a not very good bit of documentation! Bizarrely there doesn't appear to be much related info found by google.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: CM: Circulate Memory




More information about the Squeak-dev mailing list