Page MenuHomePhabricator

numeric entity references for problematic characters
Closed, InvalidPublic

Description

Author: apb

Description:
Some characetrs are not allowed in page names. For example, "#" and "|"
are not allowed at all, and "/" is not allowed at the beginning of a
page name. See [[en:Wikipedia:
Naming_conventions_(technical_restrictions)]] and the corresponding talk
page for a (probably inaccurate) description of the problem and some
workarounds.

In the case of some problematic characters, numeric entity references
can be used. For example, [[foo#bar]] is a link to anchor "bar" within
page "foo", while [[foo#bar]] is a link to page "foo#bar". However,
this does not always work. For example, attempts to use [[foo|bar]
] (representing a link that contains the pipe character) result in badly
formed HTML output, and attempts to distinguish between space and
underline using   and _ seem to result in both characters being
mapped to an underline in the URL but a space in the displayed title.

Please make the behaviour consistent (preferably in a way that is as
useful as possible), and document it. I suspect that doing this right
will need a real parser, but that fixing the | (pipe) bug will be
easier.


Version: unspecified
Severity: normal
Platform: PC

Details

Reference
bz462

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:53 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz462.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been marked as a duplicate of 337 ***

gangleri wrote:

Hallo!

I will reopen the bug (remove the DUPLICATE relation) and mark this bug as
INVALID because "#", "|" and "some" characters are not allowed in page titles.
There should be *no way* to generate such titles. Sorry! An "escape syntax" to
generate such titles would create lots of other problem.

What Alan experienced is no longer the case. The actual "escaping" behaviour can
be seen at
http://yi.wiktionary.org/w/index.php?title=project:bugzilla/00033&oldid=6887#bugzilla:00462

It includes both Alans method *and* escaping with <nowiki> </nowiki>.

The sections #b1 and #b2 show that the "escaped" generation of "foo|bar" does
not render properly. I open another bug and will mention this at bug 337.

Changing Component to "Page rendering". I can only test actual verions at
MediaWiki foundations wiki's and Brion's testwiki and have no idea about
relation to various other supported versions.

best regards reinhardt [[user:gangleri]]

gangleri wrote:

(In reply to comment #2)

The sections #b1 and #b2 show that the "escaped" generation of "foo|bar" does
not render properly. I open another bug and will mention this at bug 337.

opened
Bug 4250: Escaped generation of [[foo|bar]] does not render properly