quatuorbellefeuille.com

Content, build scripts and admin scripts for the Bellefeuille Quartet website.
git clone https://git.kevinlegouguec.net/quatuorbellefeuille.com
Log | Files | Refs

commit a7b877da001054378e86cb32bc8a9467423f7e5d
parent 66b5366b7b377f9e595ee9b97261b65a0064aa5b
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Wed, 23 Feb 2022 10:37:11 +0100

Remove superfluous whitespace from feeds

Diffstat:
Madmin/feeds/build-feed.py | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 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):