瀏覽代碼

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

tags/v0.2
Ben Kurtovic 10 年之前
父節點
當前提交
193f96451e
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. +4
    -0
      earwigbot/wiki/copyvios/parsers.py

+ 4
- 0
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


Loading…
取消
儲存