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

Bug: Tidy tab replacement in <pre> elements

From: Warren Block <wblock@wonkity.com>
Date: Sat, 7 Jan 2012 07:59:02 -0700 (MST)
To: html-tidy@w3.org
Message-ID: <alpine.BSF.2.00.1201070751280.60341@wonkity.com>
Tabs in the first line of HTML <pre> elements are replaced with the
wrong number of spaces.

(This text and the pretab.html example file available at 

Example unprocessed HTML:

>Sample with tabs in PRE elements</TITLE
>	  struct driver {
 		void	*priv;			/* driver private data */

That is a tab and two spaces before "struct".  Now process it with tidy:
% tidy -wrap 90 -raw -preserve -f /dev/null -asxml pretab.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="generator" content=
"HTML Tidy for FreeBSD (vers 7 December 2008), see www.w3.org" />
<title>Sample with tabs in PRE elements</title>
<pre class="PROGRAMLISTING">
          struct driver {
                 void    *priv;                  /* driver private data 

Note that there are only *nine* spaces instead of ten before "struct", 
and it no longer aligns with the closing bracket.

Tidy versions tested:

FreeBSD port www/tidy (tidy4-20000804_3)
tidy4 -v
HTML Tidy release date: 4th August 2000
See http://www.w3.org/People/Raggett for details

FreeBSD port www/tidy-devel (tidy-devel-090315.c_1)
tidy -v
HTML Tidy for FreeBSD released on 7 December 2008
Received on Monday, 9 January 2012 10:14:02 UTC

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