From: Ruben Beltran del Rio Date: Thu, 20 Jul 2023 06:31:02 +0000 (+0200) Subject: Escape ampersand in titles X-Git-Tag: 5.0.0 X-Git-Url: https://git.r.bdr.sh/rbdr/blog/commitdiff_plain/a9c02cac1fde01ac28dc1241d1e63f85a1ff03a2?hp=f140e92e0deb1c130f2362bc54e2af9881ab4f42 Escape ampersand in titles --- diff --git a/lib/generators/rss.js b/lib/generators/rss.js index ec45dc8..4ae3925 100644 --- a/lib/generators/rss.js +++ b/lib/generators/rss.js @@ -13,7 +13,11 @@ const internals = { extractTitle(postText) { - return postText.trim().split('\n')[0].replace('#', '').trim(); + return postText.trim() + .split('\n')[0] + .replace('#', '') + .replace(/&/g, '&') + .trim(); } };