From c50c50b1cbdd45e79c040b19839dad691d79a559 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 25 Oct 2015 17:06:06 -0700 Subject: [PATCH] Wikifetch: also strip newlines from regular paragraphs Example of problem article: https://en.wikipedia.org/wiki/2BOT_Physical_Modeling_Technologies --- Wikifetch/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Wikifetch/plugin.py b/Wikifetch/plugin.py index f3d466d..b8defed 100644 --- a/Wikifetch/plugin.py +++ b/Wikifetch/plugin.py @@ -198,6 +198,8 @@ class Wikifetch(callbacks.Plugin): b_tag.text = "%s" % (b_tag.text or '') p = p.text_content() p = p.replace('', '\x02') + # Get rid of newlines, etc., that can corrupt the output. + p = utils.str.normalizeWhitespace(p) p = p.strip() if sys.version_info[0] < 3: if isinstance(p, unicode):