HSX and the <pre> tag

2 views
Skip to first unread message

stepcut

unread,
May 26, 2010, 2:35:29 PM5/26/10
to Haskell Server Pages
Hello,

For most html tags, the extra whitespace is ignored (as the
specification dictates). But in the <pre> tag whitespace is
significant. But HSX just strips out the extra whitespace.. is there
any sensible way to use the <pre> tag with hsx?

- jeremy

Niklas Broberg

unread,
May 27, 2010, 6:38:26 AM5/27/10
to haskell-se...@googlegroups.com

This is a tricky one. And it depends on what you mean by sensible...

There is no (sensible) way to change hsx/haskell-src-exts to treat
<pre> in a special way, so it's retain whitespace always or never.
It's not clear which is the best, and I've several times wondered if
the choice I made was the right one.

You can get <pre> to retain whitespace "today" by giving it
explicitly, i.e. <pre><% " " %></pre> . Not sure if that's good
enough for you. :-)

Cheers,

/Niklas

stepcut

unread,
May 31, 2010, 11:37:49 AM5/31/10
to Haskell Server Pages
Hmm. I want to be able to embed the output of HsColour into my pages..
so not really sure that is good enough.

Maybe the parser could have a flag as to weather or not to preserve
whitespace ? (either preserve it for all elements or none?)

Not really sure.. Other options would be a special syntax you could
use on a per tag basis, <pre %s> </pre> or something..

- jeremy
Reply all
Reply to author
Forward
0 new messages