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

View File

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