[WM] patch to ettext anchor problem

Ralph Pape ralph.pape.web.de
Sun Jul 6 03:24:12 IST 2003


Hi,

as I see in the htmlsource ettext sets some anchor on h1,h2,h3 in the 
following way:

<a name="this_title" id="this_title"><h2>Welcome</h2></a>

This is _not_ correct, because the a-tag is an inline tag and is not 
allowed to have a block-tag like h2 as content. The right way should be!

<h2><a name="this_title" id="this_title">Welcome</a></h2>

I patched this. See below.

I discoverd this as I use CSS to define the color of an active link (say 
red) the h2 content became red if the mouse was over the h2 tag content. 
This isn't what I want.
I've detected this using mozilla 1.4. Mozilla 1.2.1 and IE5 are showing 
the page right, without changing the color.

After appying the patch below, my problem isn*t gone :(.
This must be a problem in Mozilla 1.4.

Any Ideas?

BTW: how can I link to such a genarated name?

Greetings Ralph


Here is the patch
-------------------------------------------------------------
--- EtText2HTML.pm.orig	2002-09-21 22:17:18.000000000 +0200
+++ EtText2HTML.pm	2003-07-06 11:58:30.000000000 +0200
@@ -572,19 +572,19 @@
    # do headings.
    $$html =~ s{(^\n+|\n\n)([^\n]+)[ \t]*\n-{3,}\n}{
      my ($pre, $text, $name) = ($1, $2, make_a_name($2));
-    "$1<a name=\"$name\" id=\"$name\"><h1>$2</h1></a>\n\n";
+    "$1<h1><a name=\"$name\" id=\"$name\">$2</a></h1>\n\n";
    }ges;
    $$html =~ s{(^\n+|\n\n)([^\n]+)[ \t]*\n={3,}\n}{
      my ($pre, $text, $name) = ($1, $2, make_a_name($2));
-    "$1<a name=\"$name\" id=\"$name\"><h2>$2</h2></a>\n\n";
+    "$1<h2><a name=\"$name\" id=\"$name\">$2</a></h2>\n\n";
    }ges;
    $$html =~ s{(^\n+|\n\n)([^\n]+)[ \t]*\n\~{3,}\n}{
      my ($pre, $text, $name) = ($1, $2, make_a_name($2));
-    "$1<a name=\"$name\" id=\"$name\"><h3>$2</h3></a>\n\n";
+    "$1<h3><a name=\"$name\" id=\"$name\">$2</a></h3>\n\n";
    }ges;
    $$html =~ s{(^\n+|\n\n)([0-9A-Z][^a-z]+)[ \t]*\n\n}{
      my ($pre, $text, $name) = ($1, $2, make_a_name($2));
-    "$1<a name=\"$name\" id=\"$name\"><h3>$2</h3></a>\n\n";
+    "$1<h3><a name=\"$name\" id=\"$name\">$2</a></h3>\n\n";
    }ges;

    # now create HRs. Currently we don't bother looking at the






More information about the Webmake-talk mailing list