# HG changeset patch # User Paul Boddie # Date 1533056921 -7200 # Node ID 80d5439ad683c9eb9dfd01eb0fd399cb1b0dce33 # Parent f9321fa1c1de18a55a6f108fcda651741564cf25 Fixed quoting of # by assuming that the first occurrence indicates a fragment, with subsequent occurrences being part of the fragment identifier. diff -r f9321fa1c1de -r 80d5439ad683 moinformat/links/html.py --- a/moinformat/links/html.py Tue Jul 31 17:39:28 2018 +0200 +++ b/moinformat/links/html.py Tue Jul 31 19:08:41 2018 +0200 @@ -20,9 +20,15 @@ """ from moinformat.links.common import Linker -from urllib import quote +from urllib import quote as _quote from urlparse import urlparse +def quote(s): + + "Quote URL path 's', preserving path separators and fragment indicators." + + return "#".join(map(_quote, s.split("#", 1))) + class HTMLLinker(Linker): "Translate Moin links into HTML links."