feed: escape quotation marks
This commit is contained in:
parent
6339724510
commit
f69c092548
@ -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 = ""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user