--- 
name: DokuWiki
fileTypes: []

firstLineMatch: ^\s*={2,}(.*)={2,}\s*$
scopeName: text.html.dokuwiki
repository: 
  php: 
    patterns: 
    - name: source.php.embedded.dokuwiki
      begin: (?:^\s*)(?=<\?(?i:php|=)?(?!.*\?>))
      applyEndPatternLast: 1
      end: (?<=\?>)(?:\s*$\n)?
      patterns: 
      - include: source.php
      comment: match only multi-line PHP with leading whitespace
    - name: source.php.embedded.dokuwiki
      begin: (?=<\?(?i:php|=)?)
      applyEndPatternLast: 1
      end: (?<=\?>)
      patterns: 
      - include: source.php
    - name: source.php.embedded.dokuwiki
      captures: 
        "1": 
          name: punctuation.definition.tag.dokuwiki
        "2": 
          name: punctuation.definition.tag.dokuwiki
      begin: (<)php(>)
      applyEndPatternLast: 1
      end: (</)php(>)
      patterns: 
      - include: source.php
  inline: 
    patterns: 
    - name: markup.bold.dokuwiki
      captures: 
        "0": 
          name: punctuation.definition.bold.dokuwiki
      begin: \*\*
      end: \*\*
      patterns: 
      - include: "#inline"
    - name: markup.italic.dokuwiki
      captures: 
        "0": 
          name: punctuation.definition.italic.dokuwiki
      begin: //
      end: //
      patterns: 
      - include: "#inline"
    - name: markup.underline.dokuwiki
      captures: 
        "0": 
          name: punctuation.definition.underline.dokuwiki
      begin: __
      end: __
      patterns: 
      - include: "#inline"
    - name: meta.image.inline.dokuwiki
      captures: 
        "1": 
          name: punctuation.definition.image.dokuwiki
        "2": 
          name: markup.underline.link.dokuwiki
        "3": 
          name: punctuation.definition.image.dokuwiki
      match: (\{\{)(.+?)(\}\})
    - name: meta.link.dokuwiki
      captures: 
        "1": 
          name: punctuation.definition.link.dokuwiki
        "2": 
          name: markup.underline.link.dokuwiki
        "3": 
          name: punctuation.definition.link.dokuwiki
      match: (\[\[)(.*?)(\]\])
    - captures: 
        "1": 
          name: punctuation.definition.link.dokuwiki
        "2": 
          name: markup.underline.link.interwiki.dokuwiki
        "3": 
          name: punctuation.definition.link.dokuwiki
      match: (\[\[)([^\[\]]+\>[^|\]]+)(\]\])
    - captures: 
        "1": 
          name: markup.underline.link.dokuwiki
      match: ((https?|telnet|gopher|wais|ftp|ed2k|irc)://[\w/\#~:.?+=&%@!\-;,]+?(?=[.:?\-;,]*[^\w/\#~:.?+=&%@!\-;,]))
    - name: meta.link.email.dokuwiki
      captures: 
        "1": 
          name: punctuation.definition.link.dokuwiki
        "2": 
          name: markup.underline.link.dokuwiki
        "3": 
          name: punctuation.definition.link.dokuwiki
      match: (<)([\w0-9\-_.]+?@[\w\-]+\.[\w\-\.]+\.*[\w]+)(\>)
uuid: 862D8B02-501E-4205-9DA4-FB7CDA7AE3DA
foldingStartMarker: (<(php|html|file|nowiki)>|<code(\s*.*)?>)|/\*\*|\{\s*$
patterns: 
- include: "#php"
- include: "#inline"
- name: string.quoted.double.dokuwiki
  endCaptures: 
    "0": 
      name: punctuation.definition.string.end.dokuwiki
  begin: "\""
  beginCaptures: 
    "0": 
      name: punctuation.definition.string.begin.dokuwiki
  end: "\""
  patterns: 
  - name: constant.character.escape.dokuwiki
    match: \\.
- name: comment.block.documentation.dokuwiki
  captures: 
    "0": 
      name: punctuation.definition.comment.dokuwiki
  begin: \(\(
  end: \)\)
- name: markup.heading.dokuwiki
  captures: 
    "1": 
      name: punctuation.definition.heading.dokuwiki
    "3": 
      name: punctuation.definition.heading.dokuwiki
  match: ^\s*(={2,})(.*)(={2,})\s*$\n?
- name: keyword.other.notoc.dokuwiki
  match: ~~NOTOC~~
- name: keyword.other.nocache.dokuwiki
  match: ~~NOCACHE~~
- name: meta.separator.dokuwiki
  match: ^\s*-{4,}\s*$
- name: markup.other.paragraph.dokuwiki
  match: \\\\\s
- name: markup.list.unnumbered.dokuwiki
  captures: 
    "4": 
      name: punctuation.definition.list_item.dokuwiki
  begin: ^((\t+)|( {2,}))(\*)
  end: $\n?
  patterns: 
  - include: "#inline"
- name: markup.list.numbered.dokuwiki
  captures: 
    "4": 
      name: punctuation.definition.list_item.dokuwiki
  begin: ^((\t+)|( {2,}))(-)
  end: $\n?
  patterns: 
  - include: "#inline"
- name: markup.other.table.dokuwiki
  begin: ^[|^]
  beginCaptures: 
    "0": 
      name: punctuation.definition.table.dokuwiki
  end: $
  patterns: 
  - include: "#inline"
- name: markup.raw.dokuwiki
  captures: 
    "1": 
      name: punctuation.definition.tag.dokuwiki
    "3": 
      name: punctuation.definition.tag.dokuwiki
  begin: (\<)(file|nowiki)(\>)
  end: (<\/)(\2)(\>)
- name: markup.raw.dokuwiki
  captures: 
    "0": 
      name: punctuation.definition.raw.dokuwiki
  begin: (%%|\'\')
  end: \1
- captures: 
    "1": 
      name: punctuation.definition.tag.dokuwiki
    "2": 
      name: punctuation.definition.tag.dokuwiki
  begin: (<)html(>)
  end: (</)html(>)
  patterns: 
  - include: text.html.basic
- name: markup.raw.dokuwiki
  match: ^((\s\s)|(\t))[^\*\-].*$
- name: markup.other.dokuwiki
  captures: 
    "1": 
      name: punctuation.definition.tag.dokuwiki
    "3": 
      name: punctuation.definition.tag.dokuwiki
  begin: (\<)(sub|sup|del)(\>)
  end: (\</)(\2)(\>)
  patterns: 
  - include: "#inline"
- name: markup.raw.dokuwiki
  captures: 
    "1": 
      name: punctuation.definition.tag.dokuwiki
    "2": 
      name: punctuation.definition.tag.dokuwiki
  begin: (<)code(?:\s+[^>]*)?(>)
  end: (</)code(>)
foldingStopMarker: (</(code|php|html|file|nowiki)>)|\*\*/|^\s*\}
