From paul at boddie.org.uk Tue Dec 19 17:37:26 2017 From: paul at boddie.org.uk (Paul Boddie) Date: Tue, 19 Dec 2017 23:37:26 +0100 Subject: [moin-user] || processing broken in Moin 1.9.9 In-Reply-To: <201711291757.16958.paul@boddie.org.uk> References: <1283338094.251949.1511617052336@ox.hosteurope.de> <201711291728.17021.paul@boddie.org.uk> <201711291757.16958.paul@boddie.org.uk> Message-ID: <201712192337.27841.paul@boddie.org.uk> On Wednesday 29. November 2017 17.57.16 Paul Boddie wrote: > > I guess that the idea was to use werkzeug.utils.escape instead of > cgi.escape in Moin, but since it breaks compatibility, this idea doesn't > make sense any more. So I'm almost inclined to think that the code should > go back to using cgi.escape, not just in the above function but more > widely. I've just been looking at this again, and upon changing the wikiutils.escape function to use cgi.escape (which actually wasn't the case in Moin 1.8 despite the cgi module being used anyway), plus adapting any non-string input values (which was done in the Moin 1.8 function), I see one troublesome test suite: MoinMoin/parser/_tests/test_text_moin_wiki.py Interestingly, this was updated to match the change in Werkzeug behaviour: - expected = r'<tablewidth="80">' + expected = r'<tablewidth="80">' See: https://bitbucket.org/thomaswaldmann/moin-1.9/commits/465cb6f5c6d7a88e5c3685d86ad20ff0e41318d5 So, it would seem that Werkzeug's modified behaviour was acknowledged, but the cascading effect of that modification was not recognised. Reverting the behaviour of wikiutils.escape to something closer to the Moin 1.8 behaviour (albeit not quoting apostrophes) seems to be the way to go: def escape(s, quote=None): if not isinstance(s, (str, unicode)): s = str(s) return cgi.escape(s, quote) Reverting the above test suite modification would also seem advisible. Does anyone have any thoughts about this? It's been almost three weeks since I noted the likely problem, but I haven't seen any other observations about it. Paul