Commit 7ff66d28 authored by Stefan Behnel's avatar Stefan Behnel

clean up some code

parent bf7f5441
......@@ -2,8 +2,8 @@
import os
import re
import time
import codecs
from xml.sax.saxutils import escape as html_escape
from StringIO import StringIO
import Version
......@@ -150,8 +150,7 @@ function toggleDiv(id) {
except KeyError:
code = ''
else:
for c, cc, html in special_chars:
code = code.replace(c, html)
code = html_escape(code)
code = _parse_code(annotate, code)
score = (5 * calls['py_c_api'] + 2 * calls['pyx_c_api'] +
......@@ -183,15 +182,6 @@ _parse_code = re.compile(
).sub
# TODO: make this cleaner
def escape(raw_string):
raw_string = raw_string.replace(u"\'", ur"’")
raw_string = raw_string.replace(u'\"', ur'"')
raw_string = raw_string.replace(u'\n', ur'<br>\n')
raw_string = raw_string.replace(u'\t', ur'\t')
return raw_string
class AnnotationItem(object):
def __init__(self, style, text, tag="", size=0):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment