]> git.r.bdr.sh - rbdr/blog/commitdiff
Escape ampersand in titles 5.0.0
authorRuben Beltran del Rio <redacted>
Thu, 20 Jul 2023 06:31:02 +0000 (08:31 +0200)
committerRuben Beltran del Rio <redacted>
Thu, 20 Jul 2023 06:31:02 +0000 (08:31 +0200)
lib/generators/rss.js

index ec45dc8f8e289363eeb8e5c9d27285aec1c4ba38..4ae39257244941db8e76821766b9ff8dfc1020af 100644 (file)
@@ -13,7 +13,11 @@ const internals = {
 
   extractTitle(postText) {
 
 
   extractTitle(postText) {
 
-    return postText.trim().split('\n')[0].replace('#', '').trim();
+    return postText.trim()
+      .split('\n')[0]
+      .replace('#', '')
+      .replace(/&/g, '&amp;')
+      .trim();
   }
 };
 
   }
 };