diff MoinMoin/formatter/text_html.py @ 4560:050428d1c044

Fix processing of anchors (fragment identifiers), see details below Fixed creole and wiki parser, other parsers might need similar fixes. IDs that are valid fragment identifiers should see no changes. IDs with blanks, non-ASCII chars etc. are now sanitized in the same way for links as well as for link targets, so the user editing a page won't have to bother with it. [[#foo bar]] will link to <<Anchor(foo bar)>> or = foo bar =. Creole heading ID creation was changed to be the same as for moin wiki markup headings (no sha1 any more, but trying to be readable). Creole anchor setting now uses the anchordef formatter function, not rawHTML. TitleIndex and WordIndex now also use IDs sanitized in that way internally.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 08 Feb 2009 04:13:22 +0100
parents af211e2f132c
children 2eaf4b42b400 b8d919e435d5
line wrap: on
line diff
--- a/MoinMoin/formatter/text_html.py	Sat Feb 07 19:27:16 2009 +0100
+++ b/MoinMoin/formatter/text_html.py	Sun Feb 08 04:13:22 2009 +0100
@@ -502,7 +502,7 @@
                     href = '%s%s%s' % (href, separator, wikiutil.makeQueryString(querystr))
                 anchor = kw.get('anchor')
                 if anchor:
-                    href = '%s#%s' % (href, anchor)
+                    href = '%s#%s' % (href, self.sanitize_to_id(anchor))
                 if wikitag_bad:
                     html_class = 'badinterwiki'