diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-23 10:37:11 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-23 10:37:11 +0100 |
| commit | a7b877da001054378e86cb32bc8a9467423f7e5d (patch) | |
| tree | 827c536753d06657f5691ab5ef3c3a92a8b34b81 | |
| parent | 66b5366b7b377f9e595ee9b97261b65a0064aa5b (diff) | |
| download | quatuorbellefeuille.com-a7b877da001054378e86cb32bc8a9467423f7e5d.tar.xz | |
Remove superfluous whitespace from feeds
| -rwxr-xr-x | admin/feeds/build-feed.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/admin/feeds/build-feed.py b/admin/feeds/build-feed.py index 5fe5c04..e835ad7 100755 --- a/admin/feeds/build-feed.py +++ b/admin/feeds/build-feed.py @@ -75,9 +75,6 @@ def join(sequence, joiner_factory): result.append(joiner_factory()) -CDATA_INDENT = 8*' ' - - def cdata_concert(concert, lang): formatters = DATE_FORMATTERS[lang] @@ -101,15 +98,17 @@ def cdata_concert(concert, lang): *(E.p(line) for line in concert.instructions.splitlines()), )) + # Do a silly dance to indent CDATA correctly. + for b in blocks: indent(b) html_blocks = (tostring(b, encoding='utf-8').decode() for b in blocks) - cdata = '\n' + '\n'.join(html_blocks) + '\n' - cdata = re.sub('^', CDATA_INDENT, cdata, flags=re.MULTILINE) + cdata = '\n'.join(html_blocks) + '\n' + cdata = re.sub('^', 8*' ', cdata, flags=re.MULTILINE) - return CDATA(cdata) + return CDATA('\n' + cdata) def generate_concert(concert, concerts_url, pubdates, lang): |
