Tidy and HTML tab spacing

Warren Block wblock at wonkity.com
Thu Jan 26 18:20:57 UTC 2012


On Fri, 20 Jan 2012, Warren Block wrote:

> The suggestion of 	 is interesting.  The problem is that tidy is changing 
> tabs to spaces while still reading the file, when it really should be 
> treating the tab as a special entity while processings tags.

Some further testing...

There are actually three versions of tidy: www/tidy, www/tidy-devel, 
and www/tidy-lib.  Although the docproj port installs the last, any can 
be used.

Replacing tabs with 	 before tidy is called is probably the most 
compatible way.  The attached patch does this with sed in the three 
doc Makefiles where tidy is used: doc.docbook.mk, doc.html.mk, 
doc.xml.mk.

How it actually works is either funny or appalling, depending on how you 
look at it.  sed replaces tabs with 	, then tidy translates the 
	 back to tabs.  Since this happens after the tabs-to-spaces code in 
tidy, the output is a literal tab.

The Makefile changes work with any of the versions of tidy.

A sample of the Porter's Handbook produced with this patch:
http://www.wonkity.com/~wblock/porters/book.html

Firefox 9 on FreeBSD renders the Makefile examples perfectly.

(Firefox 9 in WINE does not render them correctly either with tabs or 
spaces.)



More information about the freebsd-doc mailing list