[Twisted-web] twisted.web.template output encoding

Jonathan Jacobs jonathan+twisted at jsphere.com
Tue Dec 6 04:47:36 EST 2011

On Mon, Dec 5, 2011 at 22:19, Glyph <glyph at twistedmatrix.com> wrote:
> Looking at the actual output now, these &nbsp; characters strike me as an
> accident of how browsers collapse different types of whitespace.  They could
> be replaced with a <span style="width: 4em;" /> to avoid this problem for
> now, which is probably more expressive.

The "width" property does not apply to non-replaced inline elements
(i.e. "display: inline", like span) [1], "padding-left: 4em" produces
the same result though.

Apart from the fact that "padding-left: 4em" (or "width: 4em") will
not be preserved if you attempt to copy the text,
&nbsp;&nbsp;&nbsp;&nbsp; and width: 4em are not actually the same
thing and do not produce the same result, even with a monospace font.

I've attached a small document demonstrating this.

[1] <http://www.w3.org/TR/CSS2/visudet.html#the-width-property>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20111206/fd6c6a0f/attachment.html 

More information about the Twisted-web mailing list