diff options
| author | 2019-07-20 05:51:48 -0400 | |
|---|---|---|
| committer | 2019-07-20 05:51:48 -0400 | |
| commit | 38accf3526a88643ca2a7dbb6a0356f09cfeb6b8 (patch) | |
| tree | 7bd7dd9f7de7735d13d8d97140e4de1698b44728 /gallery_dl/text.py | |
| parent | 0d3bf12093addd340346bc053f2c8fecf45b30b6 (diff) | |
| parent | 2a63a9c9b7032a76894c48ac4d9cea732fcaee49 (diff) | |
Update upstream source from tag 'upstream/1.9.0'
Update to upstream version '1.9.0'
with Debian dir e4e6deed2c5d767438ea4528bc329c28c5e72178
Diffstat (limited to 'gallery_dl/text.py')
| -rw-r--r-- | gallery_dl/text.py | 7 |
1 files changed, 5 insertions, 2 deletions
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): |
