From 193f96451e229c0b114021385eb13f4336aaecde Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 20 Aug 2014 03:35:11 -0400 Subject: [PATCH] Also strip s in ArticleTextParser.strip(). --- earwigbot/wiki/copyvios/parsers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/earwigbot/wiki/copyvios/parsers.py b/earwigbot/wiki/copyvios/parsers.py index afa93c0..fc0d748 100644 --- a/earwigbot/wiki/copyvios/parsers.py +++ b/earwigbot/wiki/copyvios/parsers.py @@ -70,6 +70,10 @@ class ArticleTextParser(BaseTextParser): if link.title.strip().lower().startswith(bad_prefixes): wikicode.remove(link) + # Also strip references: + for tag in wikicode.filter_tags(matches=lambda tag: tag.tag == "ref"): + wikicode.remove(tag) + clean = wikicode.strip_code(normalize=True, collapse=True) self.clean = clean.replace("\n\n", "\n").strip() return self.clean