From 7d3863641dcb82859f9e99a43d96d41feee24b29 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 13 Apr 2022 12:48:42 +0200 Subject: [PATCH] Revert "feat: sanitize all yaml" This reverts commit 2fbc952a72c8de97a1b7782bc7076fc9b75e50de. --- lumbunglib/feed.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lumbunglib/feed.py b/lumbunglib/feed.py index b2f30df..8c2bba0 100644 --- a/lumbunglib/feed.py +++ b/lumbunglib/feed.py @@ -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 @@ -13,8 +14,7 @@ import requests from bs4 import BeautifulSoup from slugify import slugify from re import compile as re_compile -from re import sub -yamlre = re_compile('[_\?:\'\[\]\{\}\#\&\*\!\|\>\`\"\%]') +yamlre = re_compile('"') def write_etag(feed_name, feed_data): @@ -121,12 +121,12 @@ def sanitize_yaml (frontmatter): #some fields are lists l = [] for i in v: - i = yamlre.sub(r'\\\g<0>', i) + i = yamlre.sub('\\"', i) l.append(i) frontmatter[k] = l else: - v = yamlre.sub(r'\\\g<0>', v) + v = yamlre.sub('\\"', v) frontmatter[k] = v return frontmatter