瀏覽代碼

[fix] html escape

asciimoo 11 年之前
父節點
當前提交
d0427d9bae
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      searx/utils.py

+ 4
- 3
searx/utils.py 查看文件

1
 from HTMLParser import HTMLParser
1
 from HTMLParser import HTMLParser
2
-import htmlentitydefs
2
+#import htmlentitydefs
3
 import csv
3
 import csv
4
 import codecs
4
 import codecs
5
 import cStringIO
5
 import cStringIO
17
         self.result.append(unichr(codepoint))
17
         self.result.append(unichr(codepoint))
18
 
18
 
19
     def handle_entityref(self, name):
19
     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)
22
 
23
 
23
     def get_text(self):
24
     def get_text(self):
24
         return u''.join(self.result)
25
         return u''.join(self.result)