Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (26 sloc) 776 Bytes
#!/usr/bin/env python
from pandocfilters import toJSONFilter
import re
Pandoc filter that causes everything between
'<!-- BEGIN COMMENT -->' and '<!-- END COMMENT -->'
to be ignored. The comment lines must appear on
lines by themselves, with blank lines surrounding
incomment = False
def comment(k, v, fmt, meta):
global incomment
if k == 'RawBlock':
fmt, s = v
if fmt == "html":
if"<!-- BEGIN COMMENT -->", s):
incomment = True
return []
elif"<!-- END COMMENT -->", s):
incomment = False
return []
if incomment:
return [] # suppress anything in a comment
if __name__ == "__main__":
You can’t perform that action at this time.