summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthatch <devnull@localhost>2008-07-23 22:06:57 -0700
committerthatch <devnull@localhost>2008-07-23 22:06:57 -0700
commitd73de5d469217d37388acdeebec7623a860a24a8 (patch)
tree47df5cb758da4f6ffe2b5b6172b74e5e2443788c
parent8c50440accef3d64605fad11bfef3e91c3e4f340 (diff)
downloadpygments-d73de5d469217d37388acdeebec7623a860a24a8.tar.gz
Tweak priorities for php, xml, and xslt lexers so they are more precise.
-rw-r--r--pygments/lexers/web.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py
index cea0480e..c766373c 100644
--- a/pygments/lexers/web.py
+++ b/pygments/lexers/web.py
@@ -550,9 +550,10 @@ class PhpLexer(RegexLexer):
def analyse_text(text):
rv = 0.0
- for tag in '<?php', '?>':
- if tag in text:
- rv += 0.2
+ if re.search(r'<\?(?!xml)', text):
+ rv += 0.3
+ if '?>' in text:
+ rv += 0.1
return rv
@@ -634,3 +635,7 @@ class XsltLexer(XmlLexer):
yield index, Keyword, value
else:
yield index, token, value
+
+ def analyse_text(text):
+ if looks_like_xml(text) and '<xsl' in text:
+ return 0.8