diff options
Diffstat (limited to 'scripts/comments.py')
-rwxr-xr-x | scripts/comments.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/comments.py b/scripts/comments.py new file mode 100755 index 000000000..3767f973a --- /dev/null +++ b/scripts/comments.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +from pandoc import toJSONFilter +import re + +incomment = False + +def comment(k,v,format=""): + global incomment + if k == 'RawBlock': + f, s = v + fmt = f['unFormat'] + if fmt == "html": + if re.search("<!-- BEGIN COMMENT -->", s): + incomment = True + return [] + elif re.search("<!-- END COMMENT -->", s): + incomment = False + return [] + if incomment: + return [] # suppress anything in a comment + +if __name__ == "__main__": + toJSONFilter(comment) |