update smarty mode
This commit is contained in:
parent
99f49fdc49
commit
42f274a42c
2 changed files with 10 additions and 5 deletions
|
|
@ -113,13 +113,16 @@ var SmartyHighlightRules = function() {
|
|||
regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))' } ] }
|
||||
|
||||
var smartyStart = smartyRules.start;
|
||||
|
||||
|
||||
["start", "qqstring_inner", "qstring_inner", "attributes", "cdata"].forEach(function(x) {
|
||||
this.$rules[x].unshift.apply(this.$rules[x], smartyStart);
|
||||
}, this);
|
||||
|
||||
Object.keys(smartyRules).forEach(function(x) {
|
||||
if (x == "start")
|
||||
this.$rules[x].unshift.apply(this.$rules[x], smartyRules[x]);
|
||||
else
|
||||
if (!this.$rules[x])
|
||||
this.$rules[x] = smartyRules[x];
|
||||
}, this);
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@ var TextHighlightRules = function() {
|
|||
};
|
||||
|
||||
this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {
|
||||
var embedRules = new HighlightRules().getRules();
|
||||
var embedRules = typeof HighlightRules == "function"
|
||||
? new HighlightRules().getRules()
|
||||
: HighlightRules;
|
||||
if (states) {
|
||||
for (var i = 0; i < states.length; i++)
|
||||
states[i] = prefix + states[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue