pretext
pretext copied to clipboard
visible whitespace in pre and cd
Look into what we might do to make spaces (and tabs?) visible in pre and cd output.
Always visible? Publisher choice? Attribute on the pre or cd?
Only applies to space characters when leading or trailing?
And c too. @davidfarmer suggests marking each space with span.space for the presentation in HTML output.
We can have an attribute like @showspaces with values like no, all, leading, trailing, leading-trailing, etc.
I think an author needs to say/decide where they are critical/important. So not a publisher option?
Some Googling: http://jsfiddle.net/qrxLj/
In that example, js is replacing each space character with a span. We could do that or we could do XSLT text manipulation to write the span.
Something to keep in mind (maybe). Once, long long ago, PreTeXt made the decision that its pre was supposed to be like verbatim. That is not really what HTML pre does. HTML pre allows for tags inside like <b> for bold. It would be like if PTX source allowed:
<pre>
This is <em>emphasized</em>.
</pre>
Maybe that doesn't matter, but when I started thinking about having spans inside our HTML pre output, it reminded me of this difference.
Maybe a good default is to show leading space?
That would also let authors know there are options.
js is replacing each space character
We don't get JS in EPUB. :-(
We don't get JS in EPUB. :-(
But we can still do XSLT text manipulation to write the span? Or do we not want to do text manipulation like that in pretext-html?