Allow no prefix in TextHighlightRules.addRules()
This commit is contained in:
parent
ed223cb7fd
commit
d358fe61b9
1 changed files with 6 additions and 1 deletions
|
|
@ -51,6 +51,11 @@ var TextHighlightRules = function() {
|
|||
(function() {
|
||||
|
||||
this.addRules = function(rules, prefix) {
|
||||
if (!prefix) {
|
||||
for (var key in rules)
|
||||
this.$rules[key] = rules[key];
|
||||
return;
|
||||
}
|
||||
for (var key in rules) {
|
||||
var state = rules[key];
|
||||
for (var i = 0; i < state.length; i++) {
|
||||
|
|
@ -96,7 +101,7 @@ var TextHighlightRules = function() {
|
|||
if (!this.$embeds)
|
||||
this.$embeds = [];
|
||||
this.$embeds.push(prefix);
|
||||
}
|
||||
};
|
||||
|
||||
this.getEmbeds = function() {
|
||||
return this.$embeds;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue