From b9dcc94bdb6ff0f2119115805c55c878fa631402 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Mon, 20 Jan 2014 18:43:18 +0100 Subject: [PATCH] Bugfixes for IE. --- gen/wrappers/__init__.py | 4 ++-- shared/xml_parser.py | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gen/wrappers/__init__.py b/gen/wrappers/__init__.py index e7f428b..ecc4848 100644 --- a/gen/wrappers/__init__.py +++ b/gen/wrappers/__init__.py @@ -192,7 +192,7 @@ class AbstractWrapper(object): - + @@ -259,7 +259,7 @@ class AbstractWrapper(object): - +
:obj.pxNavigationStrip
diff --git a/shared/xml_parser.py b/shared/xml_parser.py index cce7014..b378d06 100644 --- a/shared/xml_parser.py +++ b/shared/xml_parser.py @@ -40,6 +40,8 @@ CUSTOM_CONVERSION_ERROR = 'Custom converter for "%s" values produced an ' \ 'error while converting value "%s". %s' XML_SPECIAL_CHARS = {'<': '<', '>': '>', '&': '&', '"': '"', "'": '''} +XML_SPECIAL_CHARS_NO_APOS = XML_SPECIAL_CHARS.copy() +del XML_SPECIAL_CHARS_NO_APOS["'"] XML_ENTITIES = {'lt': '<', 'gt': '>', 'amp': '&', 'quot': '"', 'apos': "'"} HTML_ENTITIES = { 'iexcl': '¡', 'cent': '¢', 'pound': '£', 'curren': '€', 'yen': '¥', @@ -81,8 +83,9 @@ def escapeXml(s, format='xml', nsText='text'): res = '' odf = format == 'odf' for c in s: - if XML_SPECIAL_CHARS.has_key(c): - res += XML_SPECIAL_CHARS[c] + if XML_SPECIAL_CHARS_NO_APOS.has_key(c): + # We do not escape 'apos': there is no particular need for that. + res += XML_SPECIAL_CHARS_NO_APOS[c] elif odf and (c == '\n'): res += '<%s:line-break/>' % nsText elif odf and (c == '\r'): @@ -99,8 +102,8 @@ def escapeXhtml(s): else: res = '' for c in s: - if XML_SPECIAL_CHARS.has_key(c): - res += XML_SPECIAL_CHARS[c] + if XML_SPECIAL_CHARS_NO_APOS.has_key(c): + res += XML_SPECIAL_CHARS_NO_APOS[c] elif c == '\n': res += '
' elif c == '\r':