NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 437 - "h1" is not linked in messages
"h1" is not linked in messages
Classification: Unclassified
Component: Browser-based UI
All All
: P2 normal
Assigned To: Michael[tm] Smith
: 350 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2009-01-17 07:54 CET by Simon Pieters
Modified: 2009-04-15 12:41 CEST (History)
1 user (show)

See Also:

patch with proposed fix (5.44 KB, patch)
2009-04-14 14:47 CEST, Michael[tm] Smith
updated patch (5.46 KB, patch)
2009-04-14 16:39 CEST, Michael[tm] Smith
ignore me (5.65 KB, application/octet-stream)
2009-04-15 12:10 CEST, Michael[tm] Smith
updated to fix problem variable name a literal in message string (5.65 KB, patch)
2009-04-15 12:11 CEST, Michael[tm] Smith

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pieters 2009-01-17 07:54:57 CET
Try e.g. <h1><asdf>

You may want to go through all elements in HTML5 and make sure they're linked correctly.
Comment 1 Michael[tm] Smith 2009-04-09 08:38:38 CEST
hmm, I notice that <body> is not linked either

I'd be glad to go through and add the hyperlink generation for any elements that still need it, but I'm wondering if there might be an automated way to determine which elements are currently lacking it.
Comment 2 Michael[tm] Smith 2009-04-13 12:36:40 CEST
I think the cause of the problem here is just something to specific to only h1-h6: There is no separate section in the spec only for h1; instead, there's a single h1-h6 section with all of them lumped together: like this: <h4 id=the-h1,-h2,-h3,-h4,-h5,-and-h6-elements><span class=secno>4.4.6 </span>The <dfn><code>h1</code></dfn>, <dfn><code>h2</code></dfn> etc.

I don't think the current spec-scraping code expects that case. So it needs to be updated to handle it.
Comment 3 Simon Pieters 2009-04-14 11:12:19 CEST
Also see sub and sup.
Comment 4 Michael[tm] Smith 2009-04-14 14:31:24 CEST
*** Bug 350 has been marked as a duplicate of this bug. ***
Comment 5 Michael[tm] Smith 2009-04-14 14:47:22 CEST
Created attachment 80 [details]
patch with proposed fix

This patch fixes the specific h1 problem as well as the sub/sup problem and the general problem that links will not get generated correctly for any other h4 element-section titles that contain multiple <code> children (element names).

I'm certain this is not the most elegant or efficient way to do this, but I've tested it and it does work as expected, and as far as I can see is not any more fragile than the previous code.

Note that this needs to be run against the latest version of the spec (instead of the 2008-11 version that's currently in whattf subversion) -- because there are some differences that will break the build if run  against older versions of the spec; in particular, the attributes dt is now "Content attributes" instead of "Element-specific attributes".
Comment 6 Michael[tm] Smith 2009-04-14 16:39:10 CEST
Created attachment 81 [details]
updated patch

...needs the DOTALL field set to deal with the case of h4s with embedded linebreaks
Comment 7 Michael[tm] Smith 2009-04-15 12:10:52 CEST
Created attachment 82 [details]
ignore me
Comment 8 Michael[tm] Smith 2009-04-15 12:11:43 CEST
Created attachment 83 [details]
updated to fix problem variable name a literal in message string
Comment 9 Michael[tm] Smith 2009-04-15 12:12:26 CEST
Comment on attachment 82 [details]
ignore me

flubbed when I hit submit... ignore this patch... fingers cold
Comment 10 Michael[tm] Smith 2009-04-15 12:41:55 CEST
validator/ r311