commit f8b8432595fa70baa0b10868aa1bb0404e932e78
parent 0fe53220411afb74a0ee2af955f005cb44268b8b
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Fri,  8 Jan 2021 14:03:26 +0100

Fix HTML escaping for web feeds

Now it also escapes '&' -> '&amp;'.

Diffstat:
Mgensite.py | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gensite.py b/gensite.py @@ -291,7 +291,7 @@ def make_feed(posts, dst, list_layout, item_layout, **params): if (i == max): break item_params = dict(params, **post) - item_params['c_escaped'] = post['content'].replace('>', '&gt;').replace('<', '&lt;') + item_params['c_escaped'] = post['content'].replace('&', '&amp;').replace('>', '&gt;').replace('<', '&lt;') item = render(item_layout, **item_params) items.append(item)