[Haskell-cafe] Pretty printing HTML

Neil Mitchell ndmitchell at gmail.com
Tue Dec 12 09:14:38 EST 2006


Hi,

I want to pretty print some text as HTML, using the standard HughesPJ
combinators. The problem is that I want the "length" of a text string
to be its textual context, not its character length.

For example, a keyword will display as "case", but internally will be
the string "<span class='keyword'>case</span>"

Is there any way to acheive this? I have come up with something, but
its not nice at all. It basically involves parsing the generated text
and inserting the extra HTML back in.

Thanks

Neil


More information about the Haskell-Cafe mailing list