rubbish lister
You are here: [ Homepage  ::   August 2006 ]

August 2006

Tuesday, August 1st 2006
[ Headings with EtText ]
[ Posted at 6:41pm on Tuesday, August 1st 2006 ]

It's only recently that I got around to properly exploring the use of EtText with WebMake. However, in recent times, I've been giving it a look (as well as implementing some bug fixes). The EtText documentation mentions that it takes care of ``header recognition", but gives no examples of this. In order to create a <h1> tag, simply underline a paragraph with three or more hyphen characters, i.e.:

This is a header
---

Note that there is no indent from the left margin. This is then translated into:

<a name="This_is_a_header" id="This_is_a_header">
<h1>This is a header</h1></a>

This not only creates the desired header, but allows you to link to it using an internal link. The same behaviour for the <h2> and <h3> tags can be obtained by using ``=" and ``~'' characters respectively instead of hyphens.

However, as Ralph Page notes in the mailing list, this is not valid HTML, as the <h1> block element is contained within the <a> inline element. Applying my patch causes these headers to be translated as:

<h1 id="This_is_a_header">This is a header</h1>

This achieves the same effect (including the internal linking) and passes the W3C validator.