%YAML 1.2 --- name: PandocSimple file_extensions: [md, pd] scope: text.pandoc comment: Scopes set for compatibility with Monokai Extended. variables: sp_punc: \s|\.|,|;|:|'|" contexts: main: - include: comment - match: ^$ push: blank_line prototype: - include: text_formatting - include: yaml - include: figures - include: footnotes - include: citations - include: links - include: pandoc-figref - include: pandoc-chem-struct text_formatting: - include: bold - include: italics - include: verbatim - include: math - include: subscript - include: superscript blank_line: - include: unnumbered_list - include: numbered_list - match: ^(\#)\s(.*)(\{.*\})$ captures: 1: comment.block.html 2: markup.heading.1.markdown 3: comment.block.html pop: true - match: ^(\#)\s(.*) captures: 1: comment.block.html 2: markup.heading.1.markdown pop: true - match: ^(\#\#)\s(.*)(\{.*\})$ captures: 1: comment.block.html 2: markup.heading.1.markdown 3: comment.block.html pop: true - match: ^(\#\#)\s(.*) captures: 1: comment.block.html 2: markup.heading.2.markdown pop: true - match: ^(\#\#\#)\s(.*)(\{.*\})$ captures: 1: comment.block.html 2: markup.heading.1.markdown 3: comment.block.html pop: true - match: ^(\#\#\#)\s(.*) captures: 1: comment.block.html 2: markup.heading.3.markdown pop: true - match: ^(\#\#\#\#)\s(.*)(\{.*\})$ captures: 1: comment.block.html 2: markup.heading.1.markdown 3: comment.block.html pop: true - match: ^(\#\#\#\#)\s(.*) captures: 1: comment.block.html 2: markup.heading.4.markdown pop: true - match: ^\s*(\>)(.*) # Block quote captures: 1: comment.block.markdown 2: markup.quote.markdown push: # Allows "lazy" block quotes but continues to comment leading > - match: ^\s*\> scope: comment.block.markdown - meta_scope: markup.quote.markdown - match: ^$ pop: true - match: ^(\| )(.*)(?' pop: true bold: - match: \*\*(?!\s)|(?<=\s|^)__(?!\s) # Only if spaces before/after underscores. scope: comment.block.html push: - include: pandoc-figref - include: pandoc-chem-struct - meta_scope: markup.bold.markdown - match: \*\*|(?=4 spaces. - match: (?=^\s{0,3}[^\s]) pop: true numbered_list: - match: ^\d+\.\s* push: - include: comment - include: text_formatting - meta_scope: markup.list.numbered.markdown - match: (?=^\s*$) set: - meta_scope: markup.list.numbered.markdown - include: text_formatting - match: (?=^\s{0,3}[^\s]) pop: true links: - match: (?:^|\s)(<)([^\s|!].*)(>)(?={{sp_punc}}) # Automatic link captures: 1: comment.block.html 2: string.other.link.title.markdown 3: comment.block.html - match: (\[)([^\s].*)(\]\()([^\)]*)(\)) # Inline link captures: 1: comment.block.html 2: string.other.link.title.markdown 3: comment.block.html 4: markup.underline.link.markdown 5: comment.block.html - match: (\[)([^\s][^\]]*)(\]\s?\[)([^\]]*)(\]) # Reference link captures: 1: comment.block.html 2: string.other.link.title.markdown 3: comment.block.html 4: constant.other.reference.link.markdown 5: comment.block.html - match: ^\s*(\[)(.*)(\]\:)(.*) # Reference link definition captures: 1: comment.block.html 2: constant.other.reference.link.markdown 3: comment.block.html 4: markup.underline.link.markdown - match: (?:^|\s)(?