diff --git a/README.md b/README.md index efde56a..8f9e0f7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # Vue Syntax Highlight -**Note**: the `st4` branch hosts the new syntax that only works in Sublime build > 4107. +Sublime Text Syntax highlighting for single-file [Vue.js](http://vuejs.org) components. -* For Sublime Text 2 support (`.tmlanguage` files), see `master` branch. -* For Sublime Text 3 support, see `new` branch. +The `main` branch targets Sublime Text 4. +For the Sublime Text 2 and 3 support (`.tmlanguage` files), see `st2` branch. -Sublime Text Syntax highlighting for single-file [Vue.js](http://vuejs.org) components (enabled by [vue-loader](https://github.com/vuejs/vue-loader) or [vueify](https://github.com/vuejs/vueify)). +This repository is a fork of [vuejs/vue-syntax-highlight](https://github.com/vuejs/vue-syntax-highlight) +with a focus on providing syntax highlighting only for Sublime Text.

@@ -18,20 +19,6 @@ Sublime Text Syntax highlighting for single-file [Vue.js](http://vuejs.org) comp **NOTE:** You still need to install corresponding packages for pre-processors (e.g. Pug, SASS, CoffeeScript) to get proper syntax highlighting for them. -### Enabling JSX Highlighting - -The ` tag - (?: (\s*) (-->) \s* )? (?=) \s* $ - ) - style_content_begin: '{{script_content_begin}}' - style_content_end: |- - (?x: - # optional html comment end punctuation followed by tag - (?: (\s*) (-->) \s* )? (?=) \s* $ - ) - template_content_begin: '{{script_content_begin}}' - template_content_end: |- - (?x: - # optional html comment end punctuation followed by tag - (?: (\s*) (-->) \s* )? (?=) \s* $ - ) - -contexts: - -###[ HTML TAGS ]############################################################## - - prototype: - - meta_prepend: true - - include: mustache-templates - - tag-html: - - meta_prepend: true - - include: script-tag - - include: style-tag - - include: template-tag - -###[ SCRIPT TAG ]############################################################# - - script-tag: - # for compatibility with ST builds before 4114 - - match: (<)((?i:script)){{tag_name_break}} - captures: - 1: punctuation.definition.tag.begin.html - 2: entity.name.tag.script.html - push: script-javascript - - match: (' - scope: punctuation.definition.tag.end.html - set: script-javascript-content - - include: script-common - - script-javascript-content: - # for compatibility with ST builds before 4114 - - meta_include_prototype: false - - match: '{{script_content_begin}}' - captures: - 1: comment.block.html punctuation.definition.comment.begin.html - pop: 1 # make sure to match only once - embed: scope:source.js - embed_scope: source.js.embedded.html - escape: '{{script_content_end}}' - escape_captures: - 1: source.js.embedded.html - 2: comment.block.html punctuation.definition.comment.end.html - 3: source.js.embedded.html - 4: comment.block.html punctuation.definition.comment.end.html - - script-lang-attribute: - - match: (?i:lang){{attribute_name_break}} - scope: meta.attribute-with-value.html entity.other.attribute-name.html - set: script-lang-attribute-assignment - - script-lang-attribute-assignment: - - meta_content_scope: meta.tag.script.begin.html meta.attribute-with-value.html - - match: = - scope: punctuation.separator.key-value.html - set: script-lang-attribute-value - - match: (?=\S) - set: script-javascript - - script-lang-attribute-value: - - meta_include_prototype: false - - meta_scope: meta.tag.script.begin.html meta.attribute-with-value.html - - include: script-lang-decider - - script-lang-decider: - - !script_language [ coffee, source.coffee ] - - !script_language [ livescript, source.livescript ] - - !script_language [ ts, source.ts ] - - match: (?=\S) - set: - - script-javascript - - tag-generic-attribute-meta - - tag-generic-attribute-value - -###[ STYLE TAG ]############################################################## - - style-tag: - # for compatibility with ST builds before 4114 - - match: (<)((?i:style)){{tag_name_break}} - captures: - 1: punctuation.definition.tag.begin.html - 2: entity.name.tag.style.html - push: style-css - - match: (' - scope: punctuation.definition.tag.end.html - set: style-css-content - - include: style-common - - style-css-content: - # for compatibility with ST builds before 4114 - - meta_include_prototype: false - - match: '{{style_content_begin}}' - captures: - 1: comment.block.html punctuation.definition.comment.begin.html - pop: 1 # make sure to match only once - embed: scope:source.css - embed_scope: source.css.embedded.html - escape: '{{style_content_end}}' - escape_captures: - 1: source.css.embedded.html - 2: comment.block.html punctuation.definition.comment.end.html - 3: source.css.embedded.html - 4: comment.block.html punctuation.definition.comment.end.html - - style-lang-attribute: - - match: (?i:lang){{attribute_name_break}} - scope: meta.attribute-with-value.html entity.other.attribute-name.html - set: style-lang-attribute-assignment - - style-lang-attribute-assignment: - - meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html - - match: = - scope: punctuation.separator.key-value.html - set: style-lang-attribute-value - - match: (?=\S) - set: style-css - - style-lang-attribute-value: - - meta_include_prototype: false - - meta_scope: meta.tag.style.begin.html meta.attribute-with-value.html - - include: style-lang-decider - - style-lang-decider: - - !style_language [ sass, source.sass ] - - !style_language [ scss, source.scss ] - - !style_language [ stylus, source.stylus ] - - !style_language [ postcss\?parser=sugarss, source.sss ] - - !style_language [ postcss, source.postcss ] - - !style_language [ less, source.less ] - - match: (?=\S) - set: - - style-css - - tag-generic-attribute-meta - - tag-generic-attribute-value - -###[ TEMPLATE TAG ]########################################################### - - template-tag: - - match: (<)((?i:template)){{tag_name_break}} - captures: - 1: punctuation.definition.tag.begin.html - 2: entity.name.tag.template.html - push: template-mustache - - match: (', - scope='punctuation.definition.tag.end.html', - set=[ - _rule( - match=r'{{%s_content_begin}}' % tag, - captures={ - 1: 'comment.block.html punctuation.definition.comment.begin.html', - }, - pop=1, - embed=('scope:%s' % embed), - embed_scope=('%s.embedded.html' % embed), - escape='{{%s_content_end}}' % tag, - escape_captures={ - 1: ('%s.embedded.html' % embed), - 2: 'comment.block.html punctuation.definition.comment.end.html', - 3: ('%s.embedded.html' % embed), - 4: 'comment.block.html punctuation.definition.comment.end.html', - }, - ) - ] - ), - _rule(include='%s-common' % tag), - ], - 'tag-generic-attribute-meta', - 'tag-generic-attribute-value', - ] - )