Properly escape double-quotes in wmlparser,

...the only thing not done by python's repr()
This commit is contained in:
Alexander van Gessel 2010-06-16 15:01:11 +01:00
parent d147a1255f
commit d6f6070c57

View file

@ -821,6 +821,7 @@ Massage a string into what appears to be a JSON-compatible form
"""
s = repr(string)
front = s.index("'")
s = s.replace('"', '\\"')
return '"%s"' % s[front+1:len(s)-1]
def jsonify(tree, verbose=False, depth=0):