on master help sign in
[fix] html escape
commitd0427d9baebc5abeb9f09bac54196026e56498b8 authorasciimoo <asciimoo@gmail.com> dateMon 18 Nov 2013, 16:47 (13 years ago) parentad7c83e
1 file changed+4−3
searx/utils.py+4−3
searx/utils.py+4−3
@@ -1,5 +1,5 @@
11from HTMLParser import HTMLParser
2−import htmlentitydefs
2+#import htmlentitydefs
33import csv
44import codecs
55import cStringIO
@@ -17,8 +17,9 @@ class HTMLTextExtractor(HTMLParser):
1717 self.result.append(unichr(codepoint))
1818
1919 def handle_entityref(self, name):
20− codepoint = htmlentitydefs.name2codepoint[name]
21− self.result.append(unichr(codepoint))
20+ #codepoint = htmlentitydefs.name2codepoint[name]
21+ #self.result.append(unichr(codepoint))
22+ self.result.append(name)
2223
2324 def get_text(self):
2425 return u''.join(self.result)