From 2a63a9c9b7032a76894c48ac4d9cea732fcaee49 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 20 Jul 2019 05:51:44 -0400 Subject: New upstream version 1.9.0 --- gallery_dl/text.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gallery_dl/text.py') diff --git a/gallery_dl/text.py b/gallery_dl/text.py index 151fa30..81e87b5 100644 --- a/gallery_dl/text.py +++ b/gallery_dl/text.py @@ -36,12 +36,15 @@ def clean_xml(xmldata, repl=""): return xmldata -def remove_html(txt): +def remove_html(txt, repl=" ", sep=" "): """Remove html-tags from a string""" try: - return " ".join(re.sub("<[^>]+>", " ", txt).split()) + txt = re.sub("<[^>]+>", repl, txt) except TypeError: return "" + if sep: + return sep.join(txt.split()) + return txt.strip() def split_html(txt, sep=None): -- cgit v1.2.3