Commit 65a62d4a authored by Stefan Behnel's avatar Stefan Behnel

strip C code position marker comments from annotated HTML files to a) avoid...

strip C code position marker comments from annotated HTML files to a) avoid false positives when parsing C-API calls and b) reduce the overall clutter (the HTML contains the same content already)
parent 8f684558
......@@ -150,7 +150,7 @@ function toggleDiv(id) {
except KeyError:
code = ''
else:
code = html_escape(code)
code = html_escape(_replace_pos_comment('', code))
calls = zero_calls.copy()
code = _parse_code(annotate, code)
......@@ -183,6 +183,13 @@ _parse_code = re.compile(
).sub
_replace_pos_comment = re.compile(
# this matches what Cython generates as code line marker comment
ur'^\s*/\*(?:(?:[^*]|\*[^/])*\n)+\s*\*/\s*\n',
re.M
).sub
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