--- 
name: HTML (ASP.net)
fileTypes: 
- aspx
- ascx
scopeName: text.html.asp.net
repository: 
  source-asp-embedded: 
    name: meta.source.embedded
    endCaptures: 
      "0": 
        name: punctuation.section.embedded.end.asp
    begin: <%(?![=#])
    beginCaptures: 
      "0": 
        name: punctuation.section.embedded.begin.asp
    end: "%>"
    patterns: 
    - name: source.asp.embedded.html
      begin: (?<=<%)
      end: (?=%>)
      patterns: 
      - include: source.asp.vb.net
  tag-stuff: 
    patterns: 
    - include: "#tag-id-attribute"
    - include: "#tag-generic-attribute"
    - include: "#string-double-quoted"
    - include: "#string-single-quoted"
  string-double-quoted: 
    name: string.quoted.double.html
    endCaptures: 
      "0": 
        name: punctuation.definition.string.end.html
    begin: "\""
    beginCaptures: 
      "0": 
        name: punctuation.definition.string.begin.html
    end: "\""
    patterns: 
    - include: "#embedded-code"
    - include: "#entities"
  source-asp-single-line: 
    name: meta.source.embedded.single-line
    endCaptures: 
      "0": 
        name: punctuation.section.embedded.end.asp
    begin: <%(=|#|@)
    beginCaptures: 
      "0": 
        name: punctuation.section.embedded.begin.asp
    end: "%>"
    patterns: 
    - name: source.asp.embedded.html
      begin: (?<=<%)
      end: (?=%>)
      patterns: 
      - include: source.asp.vb.net
    comment: DEBUG
  php: 
    patterns: 
    - name: source.php.embedded.html
      captures: 
        "1": 
          name: punctuation.section.embedded.php
      begin: (?:^\s*)(<\?(php|=)?)(?!.*\?>)
      end: (\?>)(?:\s*$\n)?
      patterns: 
      - include: "#php-source"
      comment: match only multi-line PHP with leading whitespace
    - name: source.php.embedded.html
      endCaptures: 
        "0": 
          name: punctuation.section.embedded.end.php
      begin: <\?(php|=)?
      beginCaptures: 
        "0": 
          name: punctuation.section.embedded.begin.php
      end: \?>
      patterns: 
      - include: "#php-source"
  php-source: 
    patterns: 
    - name: comment.line.number-sign.php
      captures: 
        "1": 
          name: punctuation.definition.comment.php
      match: (#).*?(?=\?>)
    - name: comment.line.double-slash.php
      captures: 
        "1": 
          name: punctuation.definition.comment.php
      match: (//).*?(?=\?>)
    - include: source.php
  entities: 
    patterns: 
    - name: constant.character.entity.html
      captures: 
        "1": 
          name: punctuation.definition.entity.html
        "3": 
          name: punctuation.definition.entity.html
      match: (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)
    - name: invalid.illegal.bad-ampersand.html
      match: "&"
  string-single-quoted: 
    name: string.quoted.single.html
    endCaptures: 
      "0": 
        name: punctuation.definition.string.end.html
    begin: "'"
    beginCaptures: 
      "0": 
        name: punctuation.definition.string.begin.html
    end: "'"
    patterns: 
    - include: "#embedded-code"
    - include: "#entities"
  source-asp-return: 
    name: meta.source.embedded.return-value
    endCaptures: 
      "0": 
        name: punctuation.section.embedded.end.asp
    begin: <%=
    beginCaptures: 
      "0": 
        name: punctuation.section.embedded.begin.asp
    end: "%>"
    patterns: 
    - name: source.asp.embedded.html
      begin: (?<=<%=)
      end: (?=%>)
      patterns: 
      - include: source.asp.vb.net
  source-asp-embedded-scripttag: 
    name: meta.source.embedded.script-tag
    captures: 
      "1": 
        name: punctuation.definition.tag.html
      "2": 
        name: entity.name.tag.script.html
      "3": 
        name: punctuation.definition.tag.html
    begin: (?:^\s+)?(<)(script).*runat=.server[^>]*(>)
    end: (</)(script)(>)(?:\s*$\n)?
    patterns: 
    - name: source.asp.embedded.html
      begin: (?<=(>))
      end: (?=</script>)
      patterns: 
      - include: source.asp.vb.net
  tag-id-attribute: 
    name: meta.attribute-with-value.id.html
    captures: 
      "1": 
        name: entity.other.attribute-name.id.html
      "2": 
        name: punctuation.separator.key-value.html
    begin: \b(id)\b\s*(=)
    end: (?<='|")
    patterns: 
    - name: string.quoted.double.html
      endCaptures: 
        "0": 
          name: punctuation.definition.string.end.html
      begin: "\""
      contentName: meta.toc-list.id.html
      beginCaptures: 
        "0": 
          name: punctuation.definition.string.begin.html
      end: "\""
      patterns: 
      - include: "#embedded-code"
      - include: "#entities"
    - name: string.quoted.single.html
      endCaptures: 
        "0": 
          name: punctuation.definition.string.end.html
      begin: "'"
      contentName: meta.toc-list.id.html
      beginCaptures: 
        "0": 
          name: punctuation.definition.string.begin.html
      end: "'"
      patterns: 
      - include: "#embedded-code"
      - include: "#entities"
  source-asp-bound: 
    name: meta.source.embedded.bound
    endCaptures: 
      "0": 
        name: punctuation.section.embedded.end.asp
    begin: <%#
    beginCaptures: 
      "0": 
        name: punctuation.section.embedded.begin.asp
    end: "%>"
    patterns: 
    - name: source.asp.embedded.html
      begin: (?<=<%#)
      end: (?=%>)
      patterns: 
      - include: source.asp.vb.net
  tag-generic-attribute: 
    name: entity.other.attribute-name.html
    match: \b([a-zA-Z-:]+)
  ruby: 
    name: source.ruby.embedded.html
    endCaptures: 
      "0": 
        name: punctuation.section.embedded.end.ruby
    begin: <%+(?!>)=?
    beginCaptures: 
      "0": 
        name: punctuation.section.embedded.begin.ruby
    end: -?%>
    patterns: 
    - name: comment.line.number-sign.ruby
      captures: 
        "1": 
          name: punctuation.definition.comment.ruby
      match: (#).*?(?=-?%>)
    - include: source.ruby
  asp: 
    patterns: 
    - include: "#source-asp-embedded-scripttag"
    - include: "#source-asp-embedded"
    - include: "#source-asp-bound"
    - include: "#source-asp-return"
    - name: meta.source.embedded.asp.include
      captures: 
        "1": 
          name: punctuation.definition.tag.asp
        "3": 
          name: punctuation.definition.tag.asp
      match: (<!--)\s+#include.*(-->)
  smarty: 
    patterns: 
    - captures: 
        "1": 
          name: source.smarty.embedded.html
        "2": 
          name: punctuation.section.embedded.smarty
        "3": 
          name: support.function.built-in.smarty
        "4": 
          name: punctuation.section.embedded.smarty
      begin: ((\{)(literal)(\}))
      end: ((\{/)(literal)(\}))
    - name: source.smarty.embedded.html
      captures: 
        "0": 
          name: punctuation.section.embedded.smarty
      begin: "{{|{"
      end: "}}|}"
      disabled: 1
      patterns: 
      - include: source.smarty
  embedded-code: 
    patterns: 
    - include: "#php"
    - include: "#asp"
    - include: "#smarty"
uuid: 426BF395-E61E-430F-8E4C-47F2E15C769B
foldingStartMarker: |-
  (?x)
  		(<(?i:mm:dataset|mm:insert|mm:update|asp:DataGrid|asp:Repeater|asp:TemplateColumn|head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b
  		|<!--(?!.*-->)
  		|<%(?!.*%>)
  		|\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
  		|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
  		)
patterns: 
- include: "#php"
- include: "#asp"
- include: "#smarty"
- name: meta.tag.html
  captures: 
    "6": 
      name: punctuation.definition.tag.html
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.tag.html
    "3": 
      name: punctuation.definition.tag.html
    "4": 
      name: meta.scope.between-tag-pair.html
    "5": 
      name: entity.name.tag.html
  match: (<)(\w+)[^>]*((>)</)(\2)(>)
- name: meta.tag.preprocessor.xml.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.tag.xml.html
  begin: (<\?)(xml)
  end: (\?>)
  patterns: 
  - include: "#tag-generic-attribute"
  - include: "#string-double-quoted"
  - include: "#string-single-quoted"
- name: comment.block.html
  captures: 
    "0": 
      name: punctuation.definition.comment.asp.net
  begin: <!--
  end: -->
  patterns: 
  - name: invalid.illegal.bad-comments-or-CDATA.html
    match: --
- name: meta.tag.sgml.html
  captures: 
    "0": 
      name: punctuation.definition.tag.asp.net
  begin: <!
  end: ">"
  patterns: 
  - name: meta.tag.sgml.doctype.html
    captures: 
      "1": 
        name: entity.name.tag.doctype.html
    begin: (DOCTYPE)
    end: (?=>)
    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: source.js.embedded.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.tag.script.html
  begin: (?:^\s+)?(<)((?i:script))\b(?![^>]*/>)
  end: (?<=</(script|SCRIPT))(>)(?:\s*\n)?
  patterns: 
  - include: "#tag-stuff"
  - captures: 
      "1": 
        name: punctuation.definition.tag.html
    begin: (?<!</(?:script|SCRIPT))(>)
    end: (</)((?i:script))
    patterns: 
    - include: source.js
- name: source.css.embedded.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.tag.style.html
    "3": 
      name: punctuation.definition.tag.html
  begin: (?:^\s+)?(<)((?i:style))\b(?![^>]*/>)
  end: (</)((?i:style))(>)(?:\s*\n)?
  patterns: 
  - include: "#tag-stuff"
  - begin: (>)
    beginCaptures: 
      "1": 
        name: punctuation.definition.tag.html
    end: (?=</(?i:style))
    patterns: 
    - include: source.css
- name: meta.tag.structure.any.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.tag.structure.any.html
  begin: (</?)((?i:body|head|html)\b)
  end: (>)
  patterns: 
  - include: "#tag-stuff"
- name: meta.tag.block.any.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.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)
  end: (>)
  patterns: 
  - include: "#tag-stuff"
- name: meta.tag.inline.any.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.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)
  end: (>)
  patterns: 
  - include: "#tag-stuff"
- name: meta.tag.other.html
  captures: 
    "1": 
      name: punctuation.definition.tag.html
    "2": 
      name: entity.name.tag.other.html
  begin: (</?)([a-zA-Z0-9:]+)
  end: (>)
  patterns: 
  - include: "#tag-stuff"
- include: "#entities"
- name: invalid.illegal.incomplete.html
  match: <>
- name: invalid.illegal.bad-angle-bracket.html
  match: <(?=\W)|>
foldingStopMarker: |-
  (?x)
  		(</(?i:mm:dataset|mm:insert|mm:update|asp:DataGrid|asp:Repeater|asp:TemplateColumn|head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
  		|^\s*-->
  		|^\s*%>
  		|\{\{?/(if|foreach|capture|literal|foreach|php|section|strip)
  		|(^|\s)\}
  		)
keyEquivalent: ^~A
comment: This is a modified version of the HTML language that uses ASP VB.NET for embedded source code instead of ruby. Thomas Aylott subtleGradient.com
