feed: escape quotation marks

This commit is contained in:
knoflook 2022-02-17 16:15:43 +01:00
parent 6339724510
commit f69c092548
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ from hashlib import md5
from ast import literal_eval as make_tuple from ast import literal_eval as make_tuple
from pathlib import Path from pathlib import Path
from urllib.parse import urlparse from urllib.parse import urlparse
from re import sub
import arrow import arrow
import feedparser import feedparser
@ -57,12 +58,12 @@ def create_frontmatter(entry):
published = arrow.get(published) published = arrow.get(published)
if "author" in entry: if "author" in entry:
author = entry.author author = sub('"', '\\"', entry.author)
else: else:
author = "" author = ""
if "title" in entry: if "title" in entry:
title = entry.title title = sub('"', '\\"', entry.title)
else: else:
title = "" title = ""