Tags:
create new tag
, view all tags

Bug: Headline renders incorrectly

The rendering of a headline depends on the capitalization of the text, which seems unituitive. Please consider the test case below. Upon examination of the generated HTML:

<p />
<h3><a name="iSL_pdu_tests"> iSL pdu tests </a></h3>
<p />
bla bla bla
<p />
<h3><a name="iSL_PDU_tests"> </a> iSL PDU tests </h3>
<p />
bla bla bla 
<p />
<h3><a name="ISL_pdu_tests"> </a> ISL pdu tests </h3>
<p />
bla bla bla
<p />

you will discover that while the headline text is within the anchor in the first case iSL pdu tests, in the second case, where the word PDU is capitalized, and in the third, where ISL is capitalized, the headline is outside of the anchor.

Test case

iSL pdu tests

bla bla bla

iSL PDU tests

bla bla bla

ISL pdu tests

bla bla bla

Environment

TWiki version: Athens
TWiki plugins:  
Server OS: All
Web server:  
Perl version:  
Client OS: Windows
Web Browser: IE

-- ThomasWeigert - 09 Aug 2002

Follow up

Partial TOC for Test

The following appears to be totally irrelevant to the problem ThomasWeigert is pointing out (sorry, I was just trying to better understand the problem).

I added the following partial TOC in order to try to better understand the problem -- not sure it helped -- it may be a digression. (Hover over the anchors to see differences.) All three appear to be correct in terms of capitalization, but all three seem to take me to the first heading (iSL pdu tests) -- but, now that I think about it, I don't think that's the problem that ThomasWeigert is pointing out. (And this problem seems to be either the same or related to the one that won't let you go to different instances of duplicate headings in a TOC).:

-- RandyKramer - 09 Aug 2002

What is it that you notice about the TOC? I must confess I cannot spot the difference by hovering.

-- ThomasWeigert - 09 Aug 2002

This is actually spec. Here is the comment in TWiki.pm='s =makeAnchorHeading function:

    # - Need to build '<nop><h1><a name="atext"> text </a></h1>'
    #   type markup.
    # - Initial '<nop>' is needed to prevent subsequent matches.
    # - Need to make sure that <a> tags are not nested, i.e. in
    #   case heading has a WikiName or ABBREV that gets linked

That is, named anchors gets closed prematurely in order to avoid nested anchors in case there is a WikiWord or a three letter acronym in the heading (which is the case in your second and third example).

This is not fool-proof because empty named anchors are not allowed. The problem is that we cannot simply enclose, say, the first word of the heading in a named anchor because that word might get hyperlinked down the path.

I'd be happy to incorporate a fix in case someone brings a nice solution.

Fix record

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2002-08-09 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.