Hi,

I am no expert on HTML ... so I need explicit reference to RFC or
something to justify your opinion.  

> All the examples of anchor targets (<a name="foo">) in the HTML
> standard use it to enclose some descriptive text or similar content.
> Christoph's example of using a stylesheet to highlight link targets
> certainly puts it in the realm of what the WCAG are supposed to
> describe.  But I admit, I cannot find any document that comes out and
> says so.

So this was disappointing ...

On Tue, Jan 15, 2013 at 04:22:38PM -0500, Samuel Bronson wrote:
> Control: tags -1 + patch
> 
> Well, whether or not it's more important to convert everything to
> docbook, it's a lot easier to fix *this* (especially given the number of
> packages affected):
> 

> diff --git a/tools/lib/Format/HTML.pm b/tools/lib/Format/HTML.pm
> index 590bd79..5a99c2e 100644
> --- a/tools/lib/Format/HTML.pm
> +++ b/tools/lib/Format/HTML.pm
> @@ -614,8 +614,7 @@ sub _output_heading
>       output( "\n" );
>       output( "<hr>\n" );
>       output( "\n" );
> -     output( "<h" . ( $_[1] + 2 ) . ">" );
> -     output( "<a name=\"$_[3]\"></a>" );
> +     output( "<h" . ( $_[1] + 2 ) . " id=\"$_[3]\">" );
>       output( "$_[2] " ) if length( $_[2] );
>       output( $_[0] );
>          output( "</h" . ( $_[1] + 2 ) . ">\n" );

This is bug fix not for wheezy but for jessie...  we are under freeze.

Instead of current:
  <a name="foo"></a>
  <h1>blablabla</h1>
you want:
  <h1 id="foo">blablabla</h1>
but not:
  <a id="foo"><h1>blablabla</h1></a>
nor:
  <h1><a name="foo">blablabla</a></h1>

OK. I see.  First of all, let's look at bug web paeg:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=616043
This HTML source has:
| <div class="infmessage"><hr>
| <a name="1"></a>
| <!-- request_addr: [email protected], Debian Policy List
| ...
So this is accepted ways by some people.  For example:
  http://www.bignosebird.com/tags/ahref.shtml
(I initially thought funny for this type of coding.)
This is purly easthetics.

But since you are so concerned, I googled around :-)

Official HTML4  http://www.w3.org/TR/html401/struct/links.html
Clearly, use of <a name="foo"></a> is not illegal but it says:
| Note. User agents should be able to find anchors created by empty A
| elements, but some fail to do so. For example, some user agents may not
| find the "empty-anchor" in the following HTML fragment: 
| 
| <A name="empty-anchor"></A>
| <EM>...some HTML...</EM>
| <A href="#empty-anchor">Link to empty anchor</A>

Official HTML5 http://dev.w3.org/html5/markup/a.html
| The name attribute on the a element is obsolete. Consider putting an id
| attribute on the nearest container instead.

Then I also found:
http://stackoverflow.com/questions/484719/html-anchors-with-name-or-id
Highest voted answer had:
| You shouldn’t use <h1><a name="foo"/>Foo Title</h1> in any flavor of
| HTML served as text/html, because the XML empty element syntax isn’t
| supported in text/html. However, <h1><a name="foo">Foo Title</a></h1> is
| OK in HTML4. It is not valid in HTML5 as currently drafted.
| 
| <h1 id="foo">Foo Title</h1> is OK in both HTML4 and HTML5. This won’t
| work in Netscape 4, but you’ll probably use a dozen other features that
| don’t work in Netscape 4.

So thsi all leads me to conclusion that we are at HTML4 and your patch
seems sane solution for every practical cases.

I have changed bug status to normal and will fix this for jessie.

Osamu


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to