Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions corus/third/WikiExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import argparse
import bz2
import codecs
import cgi
import fileinput
import logging
import os.path
Expand All @@ -76,6 +75,7 @@
# Python 2.7 compatibiity
if PY2:
from urllib import quote
from cgi import escape as html_escape
from htmlentitydefs import name2codepoint
from itertools import izip as zip, izip_longest as zip_longest
range = xrange # Use Python 3 equivalent
Expand All @@ -93,6 +93,7 @@ def __eq__ (self, other):
return self.__dict__ == other.__dict__
else:
from urllib.parse import quote
from html import escape as html_escape
from html.entities import name2codepoint
from itertools import zip_longest
from types import SimpleNamespace
Expand Down Expand Up @@ -808,7 +809,7 @@ def clean(self, text):
text = text.replace('|-', '')
text = text.replace('|', '')
if options.toHTML:
text = cgi.escape(text)
text = html_escape(text, quote=False)
return text


Expand Down