aboutsummaryrefslogtreecommitdiff
path: root/lib/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.py')
-rw-r--r--lib/util.py13
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('<', '&lt;')
s = s.replace('>', '&gt;')
- s = s.replace('\'', '&quot;')
+ s = s.replace('\'', '&apos;')
+ s = s.replace('\"', '&quot;')
# 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')