Selaa lähdekoodia

Also strip <ref>s in ArticleTextParser.strip().

tags/v0.2
Ben Kurtovic 9 vuotta sitten
vanhempi
commit
193f96451e
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. +4
    -0
      earwigbot/wiki/copyvios/parsers.py

+ 4
- 0
earwigbot/wiki/copyvios/parsers.py Näytä tiedosto

@@ -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


Ladataan…
Peruuta
Tallenna