aboutsummaryrefslogtreecommitdiffstats
path: root/mako/ext/pygmentplugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'mako/ext/pygmentplugin.py')
-rw-r--r--mako/ext/pygmentplugin.py4
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