summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatth?us G. Chajdas <dev@anteru.net>2019-02-12 16:00:40 +0100
committerMatth?us G. Chajdas <dev@anteru.net>2019-02-12 16:00:40 +0100
commit2920dc2735ff50fd1da7c9ff7553298f36a29d63 (patch)
tree01f39461627c23705b1df17b7122abbb367c625f
parentdc725fcaa116e5c1437c64319abca2a55a3bc11a (diff)
downloadpygments-2920dc2735ff50fd1da7c9ff7553298f36a29d63.tar.gz
Make TypeScript the default for .ts files.
-rw-r--r--CHANGES1
-rw-r--r--pygments/lexers/javascript.py4
-rw-r--r--pygments/lexers/typoscript.py2
3 files changed, 6 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index a8b63c02..3cb104fa 100644
--- a/CHANGES
+++ b/CHANGES
@@ -29,6 +29,7 @@ Version 2.4.0
- Change ANSI color names (PR#777)
- Fix rare unicode errors on Python 2.7 (PR#798, #1492)
- Updated Trove classifiers and ``pip`` requirements (PR#799)
+- For ``.ts`` files, TypeScript is assumed now (was TypoScript previously)
Version 2.3.1
-------------
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py
index 840ce9ed..87c4af2d 100644
--- a/pygments/lexers/javascript.py
+++ b/pygments/lexers/javascript.py
@@ -453,6 +453,10 @@ class TypeScriptLexer(RegexLexer):
flags = re.DOTALL | re.MULTILINE
+ # Higher priority than the TypoScriptLexer, as TypeScript is far more
+ # common these days
+ priority = 0.5
+
tokens = {
'commentsandwhitespace': [
(r'\s+', Text),
diff --git a/pygments/lexers/typoscript.py b/pygments/lexers/typoscript.py
index 7da87c75..6e1c3155 100644
--- a/pygments/lexers/typoscript.py
+++ b/pygments/lexers/typoscript.py
@@ -114,7 +114,7 @@ class TypoScriptLexer(RegexLexer):
flags = re.DOTALL | re.MULTILINE
# Slightly higher than TypeScript (which is 0).
- priority = 0.1
+ priority = 0.0
tokens = {
'root': [