diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-05 01:55:41 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-05 01:55:41 +0000 |
commit | 2bc0ea9cebeda00b0b23d633ee87cbc819829fd8 (patch) | |
tree | dc137e7210b619672b3c977ad1d323ccc7776c30 /mako/ext/pygmentplugin.py | |
parent | 524bdae950f36d540b18ee5ad7910fadf45e30d1 (diff) | |
download | external_python_mako-2bc0ea9cebeda00b0b23d633ee87cbc819829fd8.tar.gz external_python_mako-2bc0ea9cebeda00b0b23d633ee87cbc819829fd8.tar.bz2 external_python_mako-2bc0ea9cebeda00b0b23d633ee87cbc819829fd8.zip |
- A percent sign can be emitted as the first
non-whitespace character on a line by escaping
it as in "%%". [ticket:112]
Diffstat (limited to 'mako/ext/pygmentplugin.py')
-rw-r--r-- | mako/ext/pygmentplugin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mako/ext/pygmentplugin.py b/mako/ext/pygmentplugin.py index 09ffe12..2e7ff0d 100644 --- a/mako/ext/pygmentplugin.py +++ b/mako/ext/pygmentplugin.py @@ -22,7 +22,7 @@ class MakoLexer(RegexLexer): 'root': [ (r'(\s*)(\%)(\s*end(?:\w+))(\n|\Z)', bygroups(Text, Comment.Preproc, Keyword, Other)), - (r'(\s*)(\%)([^\n]*)(\n|\Z)', + (r'(\s*)(\%(?!%))([^\n]*)(\n|\Z)', bygroups(Text, Comment.Preproc, using(PythonLexer), Other)), (r'(\s*)(##[^\n]*)(\n|\Z)', bygroups(Text, Comment.Preproc, Other)), @@ -36,7 +36,7 @@ class MakoLexer(RegexLexer): (r'''(?sx) (.+?) # anything, followed by: (?: - (?<=\n)(?=%|\#\#) | # an eval or comment line + (?<=\n)(?=%(?!%)|\#\#) | # an eval or comment line (?=\#\*) | # multiline comment (?=</?%) | # a python block # call start or end |