Skip to content

Commit e169be9

Browse files
committed
Smarty: Regexp optimisation and simplification
1 parent 41a2c76 commit e169be9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

components/prism-smarty.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
pattern: /^\{|\}$/i,
1919
alias: 'punctuation'
2020
},
21-
'string': /(["'])(?:\\?.)*?\1/,
21+
'string': /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,
2222
'number': /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][-+]?\d+)?)\b/,
2323
'variable': [
2424
/\$(?!\d)\w+/,
@@ -52,7 +52,7 @@
5252
}
5353
},
5454
'punctuation': [
55-
/[\[\]().,:`]|\->/
55+
/[\[\]().,:`]|->/
5656
],
5757
'operator': [
5858
/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,

components/prism-smarty.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)