# [PackageDev] target_format: json, ext: json
---
name: Vue Template
scopeName: text.html.vue-html
fileTypes: []
uuid: ca2e4260-5d62-45bf-8cf1-d8b5cc19c8f8

patterns:
- include: '#vue-interpolations'

- name: meta.tag.any.html
  begin: (<)([a-zA-Z0-9:-]++)(?=[^>]*></\2>)
  beginCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.html}
  end: (>)(<)(/)(\2)(>)
  endCaptures:
    '1': {name: punctuation.definition.tag.end.html}
    '2': {name: punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html}
    '3': {name: punctuation.definition.tag.begin.html}
    '4': {name: entity.name.tag.html}
    '5': {name: punctuation.definition.tag.end.html}
  patterns:
  - include: '#tag-stuff'

- name: meta.tag.preprocessor.xml.html
  begin: (<\?)(xml)
  end: (\?>)
  captures:
    '1': {name: punctuation.definition.tag.html}
    '2': {name: entity.name.tag.xml.html}
  patterns:
  - include: '#tag-generic-attribute'
  - include: '#string-double-quoted'
  - include: '#string-single-quoted'

- name: comment.block.html
  begin: <!--
  end: --\s*>
  captures:
    '0': {name: punctuation.definition.comment.html}
  patterns:
  - name: invalid.illegal.bad-comments-or-CDATA.html
    match: --

- name: meta.tag.sgml.html
  begin: <!
  end: '>'
  captures:
    '0': {name: punctuation.definition.tag.html}
  patterns:
  - name: meta.tag.sgml.doctype.html
    begin: (?i:DOCTYPE)
    end: (?=>)
    captures:
      '1': {name: entity.name.tag.doctype.html}
    patterns:
    - name: string.quoted.double.doctype.identifiers-and-DTDs.html
      match: '"[^">]*"'
  - name: constant.other.inline-data.html
    begin: \[CDATA\[
    end: ']](?=>)'
  - name: invalid.illegal.bad-comments-or-CDATA.html
    match: (\s*)(?!--|>)\S(\s*)

- name: meta.tag.block.any.html
  begin: (</?)((?i:template)[a-zA-Z0-9:-]+\b)
  beginCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.block.any.html}
  end: (>)
  endCaptures:
    '1': {name: punctuation.definition.tag.end.html}
  patterns:
  - include: '#tag-stuff'

- begin: (<)(template)
  beginCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.style.html}
  end: (</)(template)(>)
  endCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.style.html}
    '3': {name: punctuation.definition.tag.end.html}
  patterns:
  - include: '#tag-stuff'
  - contentName: text.html.vue-html
    begin: (>)
    beginCaptures:
      '1': {name: punctuation.definition.tag.end.html}
    end: (?=</template>)
    patterns:
      - include: text.html.vue-html

- name: meta.tag.structure.any.html
  begin: (</?)((?i:body|head|html)\b)
  end: (>)
  endCaptures:
    '1': {name: punctuation.definition.tag.end.html}
  captures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.structure.any.html}
  patterns:
  - include: '#tag-stuff'

- name: meta.tag.block.any.html
  begin: (</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)(?!-)\b)
  beginCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.block.any.html}
  end: (>)
  endCaptures:
    '1': {name: punctuation.definition.tag.end.html}
  patterns:
  - include: '#tag-stuff'

- name: meta.tag.inline.any.html
  begin: (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)(?!-)\b)
  beginCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.inline.any.html}
  end: (/?>)
  endCaptures:
    '1': {name: punctuation.definition.tag.end.html}
  patterns:
  - include: '#tag-stuff'

- name: meta.tag.other.html
  begin: (</?)([a-zA-Z0-9:-]+)
  beginCaptures:
    '1': {name: punctuation.definition.tag.begin.html}
    '2': {name: entity.name.tag.other.html}
  end: (/?>)
  endCaptures:
    '1': {name: punctuation.definition.tag.end.html}
  patterns:
  - include: '#tag-stuff'

- include: '#entities'

- name: invalid.illegal.incomplete.html
  match: <>

- name: invalid.illegal.bad-angle-bracket.html
  match: <

repository:
  vue-interpolations:
    patterns:
    - name: expression.embedded.vue
      begin: \{\{\{?
      beginCaptures:
        '0': {name: punctuation.definition.generic.begin.html}
      end: \}\}\}?
      endCaptures:
        '0': {name: punctuation.definition.generic.end.html}
      patterns:
      - include: source.js

  vue-directives:
    name: meta.directive.vue
    begin: ((?:\b(v-)|(:|@))([a-zA-Z\-]+)(?:\:([a-zA-Z\-]+))?(?:\.([a-zA-Z\-]+))*)\s*(=)
    end: (?<='|")|(?=[\s<>`])
    captures:
      '1': {name: entity.other.attribute-name.html}
      '7': {name: punctuation.separator.key-value.html}
    patterns:
    - name: source.directive.vue
      begin: '"'
      beginCaptures:
        '0': {name: punctuation.definition.string.begin.html}
      end: '"'
      endCaptures:
        '0': {name: punctuation.definition.string.end.html}
      patterns:
      - include: source.js
    - name: source.directive.vue
      begin: ''''
      beginCaptures:
        '0': {name: punctuation.definition.string.begin.html}
      end: ''''
      endCaptures:
        '0': {name: punctuation.definition.string.end.html}
      patterns:
      - include: source.js

  entities:
    patterns:
    - name: constant.character.entity.html
      match: (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)
      captures:
        '1': {name: punctuation.definition.entity.html}
        '3': {name: punctuation.definition.entity.html}
    - name: invalid.illegal.bad-ampersand.html
      match: '&'

  string-double-quoted:
    name: string.quoted.double.html
    begin: '"'
    beginCaptures:
      '0': {name: punctuation.definition.string.begin.html}
    end: '"'
    endCaptures:
      '0': {name: punctuation.definition.string.end.html}
    patterns:
    - include: '#vue-interpolations'
    - include: '#entities'

  string-single-quoted:
    name: string.quoted.single.html
    begin: ''''
    beginCaptures:
      '0': {name: punctuation.definition.string.begin.html}
    end: ''''
    endCaptures:
      '0': {name: punctuation.definition.string.end.html}
    patterns:
    - include: '#vue-interpolations'
    - include: '#entities'

  tag-generic-attribute:
    name: entity.other.attribute-name.html
    match: (?<=[^=])\b([a-zA-Z0-9:-]+)

  tag-id-attribute:
    name: meta.attribute-with-value.id.html
    begin: \b(id)\b\s*(=)
    end: (?!\G)(?<='|"|[^\s<>/])
    captures:
      '1': {name: entity.other.attribute-name.id.html}
      '2': {name: punctuation.separator.key-value.html}
    patterns:
    - name: string.quoted.double.html
      contentName: meta.toc-list.id.html
      begin: '"'
      beginCaptures:
        '0': {name: punctuation.definition.string.begin.html}
      end: '"'
      endCaptures:
        '0': {name: punctuation.definition.string.end.html}
      patterns:
      - include: '#vue-interpolations'
      - include: '#entities'
    - name: string.quoted.single.html
      contentName: meta.toc-list.id.html
      begin: ''''
      beginCaptures:
        '0': {name: punctuation.definition.string.begin.html}
      end: ''''
      endCaptures:
        '0': {name: punctuation.definition.string.end.html}
      patterns:
      - include: '#vue-interpolations'
      - include: '#entities'
    - name: string.unquoted.html
      match: (?<==)(?:[^\s<>/'"]|/(?!>))+
      captures:
        '0': {name: meta.toc-list.id.html}

  unquoted-attribute:
    match: (?<==)(?:[^\s<>/'"]|/(?!>))+
    name: string.unquoted.html

  tag-stuff:
    patterns:
    - include: '#vue-directives'
    - include: '#tag-id-attribute'
    - include: '#tag-generic-attribute'
    - include: '#string-double-quoted'
    - include: '#string-single-quoted'
    - include: '#unquoted-attribute'
