@@ -166,6 +166,9 @@ variables:
166166 )
167167 fenced_code_block_escape : ^{{fenced_code_block_end}}
168168
169+ # https://pandoc.org/MANUAL.html#divs-and-spans
170+ fenced_div_block : :{3,}
171+
169172 # https://spec.commonmark.org/0.30/#email-autolink
170173 email_domain_commonmark : ' [a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'
171174 email_user_commonmark : ' [a-zA-Z0-9.!#$%&'' *+/=?^_`{|}~-]+'
@@ -256,6 +259,7 @@ variables:
256259 | {{block_quote}} # a blockquote begins the line
257260 | {{atx_heading}} # an ATX heading begins the line
258261 | {{fenced_code_block_start}} # a fenced codeblock begins the line
262+ | {{fenced_div_block}} # a fenced div block begins the line
259263 | {{thematic_break}} # line is a thematic beak
260264 | {{first_list_item}} # a list item begins the line
261265 | {{html_block}} # a html block begins the line
@@ -269,6 +273,7 @@ variables:
269273 | {{block_quote}} # a blockquote begins the line
270274 | {{atx_heading}} # an ATX heading begins the line
271275 | {{fenced_code_block_start}} # a fenced codeblock begins the line
276+ | {{fenced_div_block}} # a fenced div block begins the line
272277 | {{thematic_break}} # line is a thematic beak
273278 | {{list_item}} # a list item begins the line
274279 | {{html_block}} # a html block begins the line
@@ -362,6 +367,7 @@ contexts:
362367 - include : list-blocks
363368 - include : tables
364369 - include : fenced-code-blocks
370+ - include : fenced-div-blocks
365371 - include : html-blocks
366372 - include : reference-definitions
367373 - include : atx-headings
@@ -594,6 +600,7 @@ contexts:
594600 | {{reference_definition}} # a reference definition begins the line
595601 | {{atx_heading}} # an ATX heading begins the line
596602 | {{fenced_code_block_start}} # a fenced codeblock begins the line
603+ | {{fenced_div_block}} # a fenced div block begins the line
597604 | {{thematic_break}} # line is a thematic beak
598605 | {{list_item}} # a list item begins the line
599606 | {{html_block}} # a html block begins the line
@@ -705,6 +712,7 @@ contexts:
705712 (?: $ # the line is blank (or only contains whitespace)
706713 | {{atx_heading}} # an ATX heading begins the line
707714 | {{fenced_code_block_start}} # a fenced codeblock begins the line
715+ | {{fenced_div_block}} # a fenced div block begins the line
708716 | {{thematic_break}} # line is a thematic beak
709717 | {{list_item}} # a list item begins the line
710718 | {{html_block}} # a html block begins the line
@@ -732,6 +740,7 @@ contexts:
732740 (?: \s* $ # the line is blank (or only contains whitespace)
733741 | {{atx_heading}} # an ATX heading begins the line
734742 | {{fenced_code_block_start}} # a fenced codeblock begins the line
743+ | {{fenced_div_block}} # a fenced div block begins the line
735744 | {{thematic_break}} # line is a thematic beak
736745 | {{list_item}} # a list item begins the line
737746 | {{html_block}} # a html block begins the line
@@ -1147,7 +1156,6 @@ contexts:
11471156 - include : fenced-rust
11481157 - include : fenced-scala
11491158 - include : fenced-shell
1150- - include : fenced-shell-script
11511159 - include : fenced-sql
11521160 - include : fenced-tsx
11531161 - include : fenced-typescript
@@ -2007,46 +2015,24 @@ contexts:
20072015 - match : |-
20082016 (?x)
20092017 {{fenced_code_block_start}}
2010- (?i:\s*(console|shell) )
2018+ (?i:\s*(console|bash| shell(?:-script)?|sh)|zsh )
20112019 {{fenced_code_block_trailing_infostring_characters}}
20122020 captures:
20132021 0: meta.code-fence.definition.begin.shell.markdown-gfm
20142022 2: punctuation.definition.raw.code-fence.begin.markdown
20152023 5: constant.other.language-name.markdown
20162024 6: comment.line.infostring.markdown
20172025 7: meta.fold.code-fence.begin.markdown
2018- embed: scope:source.shell.interactive .markdown
2026+ embed: scope:source.shell.embedded .markdown
20192027 embed_scope:
20202028 markup.raw.code-fence.shell.markdown-gfm
2021- source.shell.interactive.markdown
2029+ source.shell
20222030 escape: '{{fenced_code_block_escape}}'
20232031 escape_captures:
20242032 0: meta.code-fence.definition.end.shell.markdown-gfm
20252033 1: punctuation.definition.raw.code-fence.end.markdown
20262034 2: meta.fold.code-fence.end.markdown
20272035
2028- fenced-shell-script :
2029- - match : |-
2030- (?x)
2031- {{fenced_code_block_start}}
2032- (?i:\s*(shell-script|sh|bash|zsh))
2033- {{fenced_code_block_trailing_infostring_characters}}
2034- captures:
2035- 0: meta.code-fence.definition.begin.shell-script.markdown-gfm
2036- 2: punctuation.definition.raw.code-fence.begin.markdown
2037- 5: constant.other.language-name.markdown
2038- 6: comment.line.infostring.markdown
2039- 7: meta.fold.code-fence.begin.markdown
2040- embed: scope:source.shell.bash
2041- embed_scope:
2042- markup.raw.code-fence.shell-script.markdown-gfm
2043- source.shell.bash
2044- escape: '{{fenced_code_block_escape}}'
2045- escape_captures:
2046- 0: meta.code-fence.definition.end.shell-script.markdown-gfm
2047- 1: punctuation.definition.raw.code-fence.end.markdown
2048- 2: meta.fold.code-fence.end.markdown
2049-
20502036 fenced-sql :
20512037 - match : |-
20522038 (?x)
@@ -3090,6 +3076,7 @@ contexts:
30903076 | {{reference_definition}} # a reference definition begins the line
30913077 | {{atx_heading}} # an ATX heading begins the line
30923078 | {{fenced_code_block_start}} # a fenced codeblock begins the line
3079+ | {{fenced_div_block}} # a fenced div block begins the line
30933080 | {{thematic_break}} # line is a thematic beak
30943081 | {{list_item}} # a list item begins the line
30953082 | {{html_block}} # a html block begins the line
@@ -3205,6 +3192,7 @@ contexts:
32053192 | {{atx_heading}}
32063193 | {{block_quote}}
32073194 | {{fenced_code_block_start}}
3195+ | {{fenced_div_block}}
32083196 | {{indented_code_block}}
32093197 | {{thematic_break}}
32103198 )
@@ -4368,6 +4356,46 @@ contexts:
43684356 - include : scope:text.tex.latex#macros
43694357 - include : scope:text.tex.latex#math-content
43704358
4359+ # ##[ EXTENSIONS: PANDOC FENCED DIVS ]##########################################
4360+
4361+ fenced-div-blocks :
4362+ # https://pandoc.org/MANUAL.html#divs-and-spans
4363+ - match : ^[ \t]*({{fenced_div_block}})[ \t]*(?=\S)
4364+ captures :
4365+ 1 : punctuation.section.block.begin.markdown
4366+ push :
4367+ - fenced-div-body
4368+ - fenced-div-puncuation
4369+ - fenced-div-attr
4370+
4371+ fenced-div-attr :
4372+ - meta_include_prototype : false
4373+ - match : \{
4374+ scope : punctuation.definition.attributes.begin.markdown
4375+ set : link-def-attr-body
4376+ - match : ' {{tag_attribute_name_start}}'
4377+ set :
4378+ - tag-attr-meta
4379+ - tag-attr-equals
4380+ - tag-attr-name
4381+ - match : else-pop
4382+
4383+ fenced-div-puncuation :
4384+ - meta_include_prototype : false
4385+ - match : ' :+'
4386+ scope : punctuation.section.block.markdown
4387+ pop : 1
4388+ - include : else-pop
4389+
4390+ fenced-div-body :
4391+ - meta_include_prototype : false
4392+ - meta_scope : meta.block.div.markdown
4393+ - match : ^[ \t]*(\1)(\s*\n)
4394+ captures :
4395+ 1 : punctuation.section.block.end.markdown
4396+ pop : 1
4397+ - include : markdown
4398+
43714399# ##[ PROTOTYPES ]#############################################################
43724400
43734401 else-pop :
@@ -4386,4 +4414,3 @@ contexts:
43864414 immediately-pop :
43874415 - match : ' '
43884416 pop : 1
4389-
0 commit comments