Created
February 16, 2016 22:33
-
-
Save scoavoux/0b56c20067541b1a07ad to your computer and use it in GitHub Desktop.
pandoc filter to pass raw latex comments, to bypass the %-escaping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# proposed this as an answer here: http://stackoverflow.com/a/35444147/4132844 | |
from pandocfilters import toJSONFilter, RawInline | |
def comments(k, v, f, meta): | |
if k == 'Str' and v in ['%TC:ignore','%TC:endignore']: | |
return RawInline('latex', v) | |
if __name__ == "__main__": | |
toJSONFilter(comments) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment