scripts/init-feed: sanitize titles/descriptions
This commit is contained in:
@@ -19,7 +19,7 @@ def try_scheme(url: str, scheme: str):
|
|||||||
|
|
||||||
def clean_item(item: dict) -> dict:
|
def clean_item(item: dict) -> dict:
|
||||||
''' remove keys/values i don't care to keep in git '''
|
''' remove keys/values i don't care to keep in git '''
|
||||||
return {
|
item = {
|
||||||
k:v for k,v in item.items() if k in [
|
k:v for k,v in item.items() if k in [
|
||||||
# "content_type",
|
# "content_type",
|
||||||
"description", # not used
|
"description", # not used
|
||||||
@@ -38,6 +38,11 @@ def clean_item(item: dict) -> dict:
|
|||||||
# "version",
|
# "version",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
# clean up characters for better printability
|
||||||
|
for k in "title", "site_name", "description":
|
||||||
|
if k not in item: continue
|
||||||
|
item[k] = item[k].replace("\u2013", "-")
|
||||||
|
return item
|
||||||
|
|
||||||
def try_load_existing_feed(path_: str) -> dict:
|
def try_load_existing_feed(path_: str) -> dict:
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user