diff --git a/demo/kitchen-sink/docs/vue.vue b/demo/kitchen-sink/docs/vue.vue index fda787f2d3..b1ff66bbc6 100644 --- a/demo/kitchen-sink/docs/vue.vue +++ b/demo/kitchen-sink/docs/vue.vue @@ -115,3 +115,5 @@ html, body each item in items li= item + + diff --git a/src/mode/_test/tokens_vue.json b/src/mode/_test/tokens_vue.json index 81d362b521..9cd3f4942a 100644 --- a/src/mode/_test/tokens_vue.json +++ b/src/mode/_test/tokens_vue.json @@ -733,4 +733,27 @@ ["meta.tag.punctuation.tag-close.xml",">"] ],[ "start" +],[ + "start", + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.tag-name.xml","template"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","v-"], + ["entity.other.attribute-name.xml","slot"], + ["entity.other.attribute-name.xml",":item"], + ["entity.other.attribute-name.xml",".parentkey.subkey.subkey.subkey.subkey.subkey"], + ["punctuation.separator.key-value.xml","="], + ["string","\""], + ["paren.lparen","{"], + ["text"," "], + ["identifier","value"], + ["text"," "], + ["paren.rparen","}"], + ["string","\""], + ["meta.tag.punctuation.tag-close.xml",">"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start" ]] \ No newline at end of file diff --git a/src/mode/vue_highlight_rules.js b/src/mode/vue_highlight_rules.js index eb3223a9ea..36d4408e19 100644 --- a/src/mode/vue_highlight_rules.js +++ b/src/mode/vue_highlight_rules.js @@ -84,7 +84,7 @@ var VueHighlightRules = function (options) { var self = this; VueRules.tag_stuff.unshift({//vue-directives token: "string", - regex: /(?:\b(v-)|(:|@))(\[?[a-zA-Z\-.]+\]?)(?:(\:\[?[a-zA-Z\-]+\]?))?(?:(\.[a-zA-Z\-]+))*(\s*)(=)(\s*)(["'])/, + regex: /(?:\b(v-)|(:|@))(\[?[a-zA-Z\-.]+\]?)(?:(\:\[?[a-zA-Z\-]+\]?))?((?:\.[a-zA-Z\-]+)*)(\s*)(=)(\s*)(["'])/, onMatch: function (value, currentState, stack) { var quote = value[value.length - 1]; stack.unshift(quote, currentState);