W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2001

Re: Question about pre tag transformation

From: Richard A. O'Keefe <ok@atlas.otago.ac.nz>
Date: Mon, 5 Mar 2001 12:57:28 +1300 (NZDT)
Message-Id: <200103042357.MAA10757@atlas.otago.ac.nz>
To: hokamoto@mse.mei.co.jp
Cc: html-tidy@w3.org
	HTML Tidy transforms a line in html content like below A to a line in xml content like below B.
	
	A.
	<A>AAAAAAA
	
	B.
	AAAAAAA
	
	<A> is lost by HTML Tidy.
	I want HTML Tidy to transform a line A to a line A.
	
I note that http://www.w3.org/TR/html401/struct/Links.html#h-12.2
says quite explicitly:

    Authors may create an A element that specifies no anchors,
    i.e. that doesn't specify href, name, or id.  Values for
    these attributes may be set at a later time through scripts.

This means that deleting bare <A> tags is definitely a bug.

What can you do about it?

In parser.c, find the function ParseInline().

Find (near the top of that function), the statements

    if (element->tag == tag_a)
    {
        if (element->attributes == null)
        {
            ReportWarning(lexer, element->parent, element, DISCARDING_UNEXPECTE
            DiscardElement(element);
            return;
        }
    }

Delete those statements.  I have tested this change.
Received on Sunday, 4 March 2001 18:57:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:45 GMT