Steve McMillen wrote:
The table of contents feature is very nice but I have one feature request if you think its not too much of a corner case.
I use front page now and I've written a front page macro that creates a table of contents. As an option, I can tell it to add numerbing to the actual elements (<h1>, <h2>, etc). When this option is enabled, a section number is prepended to each heading where <h1> is prepended with 1.x, <h2> is prepended with 1.x.x and so on. This may actually be an independent feature like "Create Section Numbering".
I am not very fond of adding the numbering in the markup but since that's the only way to make sure that all existing browsers show a numbering, why not.
</Daniel>
Yeah, its kinda messy since you have to make a pretty questionable assumption about the actual content of the page. That is, you have to assume the contents of the heading tags do not start with a number. Actually, when I wrote this in FrontPage there was no regexp function. With regexp available in JavaScript, it would be authored so that you look specifically for a pattern of "#."s follows by a space and strip that off the front of each heading if it exists. With that assumption, you would be more safe with stripping off previously added heading numbers but there is always the chance you remove original content.
Its not the most elegant solution but, like you say, there is no way to otherwise achieve this type of functionality within HTML unless you manually add heading numbering which is a real pain.
Steve _______________________________________________ mozilla-editor mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-editor
