Last modified: 2010-05-15 15:59:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13625, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11625 - Extensions are Blind to IDs and Anchor Names Already in Use
Extensions are Blind to IDs and Anchor Names Already in Use
Status: RESOLVED DUPLICATE of bug 7356
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.11.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-10 19:21 UTC by David
Modified: 2010-05-15 15:59 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description David 2007-10-10 19:21:27 UTC
If I have an extension that creates a destination anchor, there's no way for the extension to verify that the id/anchor name is not already assigned to a different HTML tag.  I've a small extension I've put together that essentially creates an anchor name in the same way headers do.  So if I have:

    <anc>'''Runnin' Down''' [[A Dream]]</anc>

The <anc> tag strips out the markup leaving "Runnin' Down A Dream" and uses that text to create the ID "Runnin.27_Down_A_Dream".  After all is said and done, the output HTML is:

    <span id="Runnin.27_Down_A_Dream"><b>Running Down</b> <a href="/wiki/index.php?title=A_Dream&amp;action=edit" class="new" title="A Dream">A Dream</a></span>

The benefit would be similar to headers in that it will create predictable destination anchor names, but, unlike headers, they wouldn't show up in the TOC, nor have an "edit" link for section editing.  Similar to bug #7356, given the following:

    <anc>content</anc>

the tag extension will generate a span tag with id="content", which shouldn't happen because a MediaWiki creates a div tag with the same ID.  The same also applies to headers.  The markup:

    === wiki-markup ===

    <anc>wiki-markup</anc>

Will produce an anchor name identical to the id generated by the anc tag.
Comment 1 Roan Kattouw 2007-10-11 12:15:08 UTC
You shouldn't need to use this extension. Rather, create a [[Template:Anchor]] that contains:

<span id="{{{id|{{{1}}}}}}">{{{1}}}</span>

Then you can use

{{anchor|content}}

which will output <span id="content">content</span>, or:

{{anchor|id=abc|def}}

which will output <span id="abc">def</span>
Comment 2 David 2007-10-11 16:12:04 UTC
That works fine if the template argument doesn't have any markup.  But if you try that with the first example I gave, you get id as:

    .27.27.27Runnin.27_Down.27.27.27_.5B.5BA_Dream.5D.5D

when what I want is:

    Runnin.27_Down_A_Dream

Anyway, whether I need the extension or not is beside the point.  Neither solution will ensure the id is unique.
Comment 3 Roan Kattouw 2007-10-11 16:13:20 UTC
(In reply to comment #2)
> Anyway, whether I need the extension or not is beside the point.  Neither
> solution will ensure the id is unique.
> 

True, but then this is just a duplicate of bug 7356.

*** This bug has been marked as a duplicate of bug 7356 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links