diff options
author | Jordan <me@jordan.im> | 2020-06-16 18:24:04 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2020-06-16 18:24:04 -0700 |
commit | b9d9ce7c7488ea1789ef3b31eb5a0c4e7a2eddb2 (patch) | |
tree | e4d887c485d8dcfb36fedc0f4d314593123f996f /lib | |
parent | db9c587be13eaab1aa83d5fb277dde39c807d393 (diff) | |
download | roka-b9d9ce7c7488ea1789ef3b31eb5a0c4e7a2eddb2.tar.gz roka-b9d9ce7c7488ea1789ef3b31eb5a0c4e7a2eddb2.zip |
rm prettify, correct quote/apos escape
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/util.py b/lib/util.py index 74d795d..ac1c904 100644 --- a/lib/util.py +++ b/lib/util.py @@ -43,7 +43,8 @@ def escape(s): s = s.replace('&', '&') s = s.replace('<', '<') s = s.replace('>', '>') - s = s.replace('\'', '"') + s = s.replace('\'', ''') + s = s.replace('\"', '"') # https://stackoverflow.com/a/22273639 illegal_unichrs = [ @@ -77,14 +78,6 @@ def escape(s): return s -def prettify(elem): - ''' - Make our RSS feed picturesque :) - ''' - xml_str = ET.tostring(elem, encoding='utf8', method='xml') - xml_dom = minidom.parseString(xml_str) - return xml_dom.toprettyxml(indent=' ') - def generate_rss(request, books): book = request.args.get('a') # audiobook hash @@ -168,5 +161,5 @@ def generate_rss(request, books): } ET.SubElement(item, 'enclosure', enc_attr) - return rss + return ET.tostring(rss, encoding='utf8', method='xml') |