Description

Markup:

 * MoinMoin:FrontPage#anchor broken
 * [[MoinMoin:some page#anchor]] broken
 * [[some page#anchor]] works
 * [[my #1 page#anchor]] works
 * [[C##|C#]] hackish, but works

Renders as:

Note that for interwiki, the #anchor is seen as part of the pagename (because # is escaped), but for local links, it is split from the pagename and seen as an anchor (because # is not escaped).

Component selection

Details

MoinMoin Version

1.8.1

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

Don't use anchors with interwiki links.

Discussion

The fundamental problem underlying is escaping. What shall we escape by default and what not?

(!) Please note that we not only have to think about # in pagenames, but also in filenames - as both will be just item names in a future moin. Depending on the backend or other requirements, filenames might be given by the filesystem, so we might have no influence on whether they contain # or not.

How to solve?

Forbid # in page names

If we do that, every # can be handled as an anchor separator.

But, there will be no pages about:

Wiki engines doing it that way: mediawiki, oddmuse, jspwiki

Just use rightmost # as anchor separator

(!) This is the solution for 1.8.x, implemented by http://hg.moinmo.in/moin/1.8/rev/af211e2f132c

The real solution (tm)

(!) Should be done after BastianBlank's dom-refactoring repo is merged.

Short term consistency fix

For 1.8.1, 1.9 and 2.0 (dom stuff is likely to get merged after 2.0), we should make behaviour consistent.

I guess the easiest way is to handle interwiki like we handle local page links (i.e. just splitting pagename and anchor at the rightmost #). This just works for most cases and for the rare case you have a # in the pagename, you have to do the slightly dirty hack with the trailing #. As many other wikis do not allow # within the page name and that case is rather rare in general, that hack will be rarely used.

(!) This is the solution for 1.8.x, implemented by http://hg.moinmo.in/moin/1.8/rev/af211e2f132c

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/AnchorsHandledInconsistently (last edited 2009-01-18 12:03:56 by ThomasWaldmann)