[squeak-dev] swiki source suited to recent Squeaks
tim Rowledge
tim at rowledge.org
Tue Aug 6 17:06:38 UTC 2019
> On 2019-08-05, at 10:50 PM, Chris Cunnington <brasspen at gmail.com> wrote:
>
> Copy this code into a Workspace and DoIt.
>
> Installer ss
> project: 'MetacelloRepository';
> install: 'ConfigurationOfXMLParser'.
> (Smalltalk at: #ConfigurationOfXMLParser) project bleedingEdge load
OK, so yet another "I couldn't spot this with google" moment. What fun.
It does at least load. And then of course I had to load the XTreams stuff because I foolishly thought trying a cleaner image might be smart after all the 'fun' of previous attempts.
>
> wikiGrammar := PEGParser grammarWiki reading.
> wikiParser := PEGParser parserPEG parse: 'Grammar' stream: wikiGrammar actor: PEGParserParser new.
> input := 'Single paragraph with *bold* and _italic_ text and a [link]' reading.
> wikiParser parse: 'Page' stream: input actor: PEGWikiGenerator new
>
> And you’ll get this.
>
> <div><p>Single paragraph with <span style="font-weight: bold">bold</span> and <span style="font-style: italic">italic</span> text and a <a href="link.html">an OrderedCollection($l $i $n $k)</a></p></div>
Just for fun I did try that in the earlier-dirty image and it failed because somewher it decided that 'link' was an orderedcollection of symbols instead of a string. Made for an amusing crash within XMLWriter>>#write:escapedWith:
In a start-from-clean image it did actually do what your show. Thank you for that. I really think a simpler solution would be nice here. Adding 4Mb to an image for a simple swiki markup parser seems a bit much.
tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: RDL: Rotate Disk Left
More information about the Squeak-dev
mailing list
|