atom feed24 messages in org.freebsd.freebsd-docRe: Tidy and HTML tab spacing
FromSent OnAttachments
Warren BlockJan 18, 2012 2:49 pm 
Hiroki SatoJan 18, 2012 3:44 pm 
Warren BlockJan 18, 2012 5:13 pm 
Hiroki SatoJan 18, 2012 10:57 pm 
Warren BlockJan 20, 2012 12:05 pm.c
Gabor KovesdanJan 21, 2012 3:16 pm 
Warren BlockJan 21, 2012 4:29 pm 
Gabor KovesdanJan 23, 2012 9:07 am 
Warren BlockJan 23, 2012 11:38 am.py
Hiroki SatoJan 24, 2012 5:23 pm 
Gabor KovesdanJan 24, 2012 6:15 pm 
Hiroki SatoJan 24, 2012 6:18 pm 
Warren BlockJan 26, 2012 10:20 am 
Warren BlockJan 26, 2012 10:22 am.diff
Hiroki SatoJan 26, 2012 7:45 pm 
Warren BlockJan 26, 2012 9:46 pm.diff
Hiroki SatoJan 26, 2012 10:50 pm.diff
Hiroki SatoJan 27, 2012 5:24 am.diff
Warren BlockJan 27, 2012 7:53 am.diff
Hiroki SatoJan 27, 2012 8:58 am.diff
Warren BlockJan 27, 2012 11:43 am 
Hiroki SatoJan 28, 2012 12:57 am 
Warren BlockJan 28, 2012 2:47 pm 
Hiroki SatoJan 28, 2012 10:24 pm 
Subject:Re: Tidy and HTML tab spacing
From:Hiroki Sato (hr@FreeBSD.org)
Date:Jan 18, 2012 10:57:13 pm
List:org.freebsd.freebsd-doc

Warren Block <wbl@wonkity.com> wrote in <alpi@wonkity.com>:

wb> > I think this will break the results because a newline just after ">" wb> > is recognized as CDATA. wb> wb> A test run on the Porter's Handbook did seem to work: wb> make -C /usr/ports/www/tidy-devel deinstall wb> make clean book.html wb> perl -0777 -i -pe wb> 's/CLASS="PROGRAMLISTING"\n\>/CLASS="PROGRAMLISTING"\>\n/g' book.html wb> make -C /usr/ports/www/tidy-devel install clean wb> tidy -wrap 90 -m -raw -preserve -f /dev/null -asxml book.html

Yes, but this just covers the issue because column calculation by Tidy is based on literals in the markup text, not on the result text. For example, in the following line

[tab]foo

Tidy expands [tab] to spaces based on the length of ">[tab]foo" regardless of the fact that ">" is not a character in the result text. So, if we convert this into two line like the following:

[tab]foo

the expansion of the [tab] will be correct. However, this trick does not always work as intended. One is that \n just after ">" means a newline in <pre>, not automatically ignored. So, all of <programlisting> will have a empty line at the top. Another is that this is valid only for a particular case. For example:

<programlisting>foo[tab]<emphasis>bar</emphasis>[tab]baz foo[tab]bar[tab]baz</programlisting>

The <emphasis> will be converted to <span> in the HTML output and two lines of "foo bat baz" will not be aligned because Tidy counts the <span> tag for the tab expansion. This cannot solve by converting "\n>" to ">\n" at the end of a <pre> tag in the HTML output.

It is difficult to solve this issue completely because the result text can be obtained only by a complete HTML processor such as www browsers. I don't have a good idea, but I think it is not a bad idea to use a tab character (or replacing it to &#09;) in the result text by modifying Tidy and leave the processing to www browsers.

-- Hiroki