Description

Entities are escaped in urls and headings, but not in body text when allow_numeric_entities is enabled.

Steps to reproduce

  1. Create a wiki node with an © or any other HTML entity like ì, or ì (the same as igrave) in a heading, URL, or even the sitename configuration. and the entities are escaped by MoinMoin to ì even when allow_numeric_entities is on, (or I have a allow_symbolic_entities patch applied to my code base).

Example

Untìl URU Wiki node

=== Test heading with entities ì ì ===

Test heading with entities ì ì

Details

1.2.x and 1.3.x

Workaround

alter wikiutil.escape function to accept a third parameter of "amp=None" and do a

if amp:
   s = s.replace("&", "&")

And have the PAgeEditor call wikiutil.escape with an additial parameter of 1 (or entities won't be properly saved)

Discussion

There has be a cleaner/easier way to accomplish this. It works fine in regular text body, but not in the === headings, in the html title, or in any urls. or in {{{ escaped text. But for the site linked above, this is needed. I have just upgraded from 1.2.4 to 1.3.4 and haven't yet applied all the patches as I was trying to find a cleaner implementation, or some other way to allow users to add in entitied characters into the wiki.

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/EntitiesInHeadingAndUrls (last edited 2007-10-29 19:22:43 by localhost)