W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2012

Re: Not changing whitespace in certain elements

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Mon, 09 Jan 2012 22:27:47 +0100
To: Warren Block <wblock@wonkity.com>
Cc: html-tidy@w3.org
Message-ID: <apmmg71tnpeaj4892tvjir2bcgv9qd9rce@hive.bjoern.hoehrmann.de>
* Warren Block wrote:
>Line 8 starts with a tab, and line 9 starts with two tabs.  This 
>particular example is from a Makefile, where tabs are significant.  Left 
>alone, the text can be copied from the browser, and the tabs are obvious 
>from the highlighting.  But tidy replaces the tabs with spaces.
>Is there a way to get tidy to leave whitespace alone inside this class 
>of <pre> elements?

Tidy should never generate tabs (and you are not supposed to use them
per the HTML 4 Recommendation inside <pre> elements). Not changing the
white space is a bit difficult while also pretty printing the document,
and it is likely that the code makes various assumptions about cleanup
with respect to white spaces that would probably make this difficult to
implement, especially if this is supposed to preserve tabs.
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Monday, 9 January 2012 21:34:54 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:58 UTC