Last modified: 2010-06-21 21:11:47 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 T2670, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 670 - special characters in anchor part of interwiki links not escaped 'correctly'
special characters in anchor part of interwiki links not escaped 'correctly'
Status: RESOLVED WORKSFORME
Product: Wikimedia
Classification: Unclassified
Interwiki links (Other open bugs)
unspecified
PC Windows XP
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://meta.wikimedia.org/wiki/User:G...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-09 20:13 UTC by lɛʁi לערי ריינהארט
Modified: 2010-06-21 21:11 UTC (History)
3 users (show)

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


Attachments

Description lɛʁi לערי ריינהארט 2004-10-09 20:13:02 UTC
Dear friends,

Please take a look at 
http://meta.wikimedia.org/wiki/User:Gangleri/remarks#InterW
iki_link_translation and 
http://en.wikipedia.org/wiki/User:Gangleri/remarks#proper_l
ink_translation .

Please see the differences. Thanks!

Regards Reinhardt
Comment 1 lɛʁi לערי ריינהארט 2004-11-10 02:31:52 UTC
More about anchors:

Part I: Just for your information. Would be to much to fix.

a) Sections and subsection titels can look very odd.

See [[:en:Wikipedia 
talk:Categorization#Poll_about_Category:Whatever.7C.2A_.2C_.7C.28space.29.2C
_.7C.21|en:Wikipedia talk:Categorization#Poll about Category:Whatever|* , |
(space), |!]] and look how the link to the anchor was made.

b) Tray to create a section / subsection and use an internal link [[foo]] 
and /or an interwiki link [[:zn:foo]] or an external link 
[http://www.foo.int/ foo] in the title. Save the section / subsection and 
look at the url in your browser.

c) Tray to use '''font''' ''styles'' and / or "quotes" and / or 'marks' as 
title. Tray all the special characters !%&?*# and so on.

Part B:

At [[:is:Notandi:Gangleri/test/Snið:Flokkatré]] there are 
two "'''anchors'''" <nowiki><font id="Landafraedi" /> and <font 
id="Island" /></nowiki>. They work only because in both cases special 
characters as "æð" in "Landafræði" and "Í" in "Ísland" have been replaced.

I would be happy, if the issue with the special characters and ( and ) 
could be solved.

Best regards ~~~~
Comment 2 lɛʁi לערי ריינהארט 2004-11-10 16:04:51 UTC
See also [[bug 845]] and [[test:User:Gangleri/tests/anchors]].
Regards Reinhardt
Comment 4 lɛʁi לערי ריינהארט 2004-11-16 04:54:51 UTC
Additional remark(s):

Spaces (also multiple subsequent spaces) are translated correctly in an 
anchor of an interwiki link.

See some examples (and an link to real "[[en:Pathology|pathological]]" 
anchor) at http://test.wikipedia.org/w/index.php?title=User%3AGangleri%
2Ftests%2Fanchors&diff=0&oldid=4348

Regards Reinhardt
Comment 5 Rowan Collins [IMSoP] 2005-04-06 17:45:16 UTC
If I understand this report correctly, the precise problem can be summarised as
follows (for reference, this paragraph would have been an ideal initial comment
for this bug report):

When typing an internal link to a section, you can use "special" characters like
"(", ")", etc and they will be converted to the "escaped" forms like ".28" and
".29" (e.g. "[[#foo (bar)]]" is equivalent to "[[#foo_.28bar.29]]"). However,
InterWiki links don't undergo this transformation, resulting in invalid links
(e.g. "[[fr:Foo#foo (bar)]]" will create a link to .../wiki/foo#foo_%28bar%29
not .../wiki/foo#foo_.28bar.29)

I think this is basically a matter of how much we assume to know about the
target of an interwiki link - many interwiki links are to non-MediaWiki sites,
which won't follow these special escaping rules. One possibility would be to
escape the link differently depending whether the interwiki prefix is marked in
the database as "local" or not (i.e. assume that everything 'local' is a
MediaWiki, and everything else isn't).

At first sight, it would seem logical to make incoming URLs with "wrong"
characters in behave as though they had them escaped, but this is awkward
because the wiki can't manipulate the address requested other than telling the
browser to reload as though it was a different page (it's entirely up to the
browser to scroll the page based on text after the "#").



To reply to some other comments:

(In reply to comment #1)
> a) Sections and subsection titels can look very odd.

There's really not a lot that can be done about that; escaping of some kind is
inevitable unless we simply restrict what characters headings can contain.
However, when working correctly, you should never have to type these escaped
forms, so it shouldn't matter.
 
> b) Tray to create a section / subsection and use an internal link [[foo]] 
> and /or an interwiki link [[:zn:foo]] or an external link 
> [http://www.foo.int/ foo] in the title. Save the section / subsection and 
> look at the url in your browser.

That's an unrelated bug: the "add section" code is guessing wrong what the
anchor will be on the final page. It might be worth filing another bug for.

> At [[:is:Notandi:Gangleri/test/Snið:Flokkatré]] there are 
> two "'''anchors'''" <nowiki><font id="Landafraedi" /> and <font 
> id="Island" /></nowiki>. They work only because in both cases special 
> characters as "æð" in "Landafræði" and "Í" in "Ísland" have been replaced.

I'm not sure what you mean here; in what sense did they "not work" before this
change? Can you come up with a simplified test-case to demonstrate? If you just
mean that interwiki links weren't generated correctly, as with the main issue in
this report, then that is to be expected, for exactly the same reasons.
Comment 6 Richard J. Holton 2005-04-06 19:25:48 UTC
At least _part_ of the issue here is the difference between the way that the
parser creates anchors from headings (for the purpose of linking from the TOC),
and the way that in-page targets are handled in links (e.g. [[PAGE NAME#heading]].

The code in parser.php (function formatHeading) seems to do more work to ensure
that the anchor can be linked to. In linker.php, function makeKnownLinkObj, the
code is a bit simpler (less robust?), and a very similar bit of code exists in
editPage.php, function sectionAnchor.

Given the relative opacity of the code in parser.php, I'm not sure how practical
it would be to pull the code there into a function visible from linker and
editPage. Something along this line is probably needed.
Comment 7 Wikipedia:en:User:Paddu 2005-04-10 09:39:50 UTC
(In reply to comment #5)
> > b) Tray to create a section / subsection and use an internal link [[foo]] 
> > and /or an interwiki link [[:zn:foo]] or an external link 
> > [http://www.foo.int/ foo] in the title. Save the section / subsection and 
> > look at the url in your browser.
> 
> That's an unrelated bug: the "add section" code is guessing wrong what the
> anchor will be on the final page. It might be worth filing another bug for.

Filed as bug 1860.
Comment 8 lɛʁi לערי ריינהארט 2005-06-11 10:53:28 UTC
bug 2381: "enhancement request: traying to achive copy and past anchors"
suggests a workaround to handle some / many of the described anchors
Comment 9 Conrad Irwin 2010-06-21 21:11:47 UTC
At some point in the last 5 years and 10 days, the parser started anchor-escaping interwiki links in the same way as local links. There are other bugs with anchor link generation, see bug 18431 and bug 5019 et.al., but I think the issue identified in comment 5 has been solved, so I'm closing this bug.

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


Navigation
Links