"Lee Daniel Crocker" <lee(a)piclab.com> wrote in message
news:1118169317.6025.4.camel@penguin.piclab.com...
[snip]
The cleanest fallback is to assume (and implicitly
number) the missing
intermediate: The example above should be numbered
== 1
==== 1.1.1
==== 1.1.2
=== 1.2
=== 1.3
Thanks for the heads-up; I'll make sure it's properly specified
in the syntax. One of the major goals of a markup language for
non-technical users is robust and well-defined behavior regardless
of user mistakes.
Excellent, but one point: could such an implicit header be numbered 0
(zero)?
Should be easy: you simply start the article with counts for each header
level set to zero and increment when you hit a real header at that level.
OK so it gets a bit interesting if people include "=" headers, but the
entire article has to be check in order to prepare the TOC anyway, so the
process could simply start the displayed numbers at the highest level
actually used.
So if an article only had "====" headers, they would logically be numbered
"0.0.0.1; 0.0.0.2; 0.0.0.3" but display as "1; 2; 3".
--
Phil
[[en:User:Phil Boswell]]