@@ -172,6 +172,9 @@ variables:
172172 )
173173 fenced_code_block_escape : ^{{fenced_code_block_end}}
174174
175+ # https://pandoc.org/MANUAL.html#divs-and-spans
176+ fenced_div_block : :{3,}
177+
175178 # https://spec.commonmark.org/0.30/#email-autolink
176179 email_domain_commonmark : ' [a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'
177180 email_user_commonmark : ' [a-zA-Z0-9.!#$%&'' *+/=?^_`{|}~-]+'
@@ -262,6 +265,7 @@ variables:
262265 | {{block_quote}} # a blockquote begins the line
263266 | {{atx_heading}} # an ATX heading begins the line
264267 | {{fenced_code_block_start}} # a fenced codeblock begins the line
268+ | {{fenced_div_block}} # a fenced div block begins the line
265269 | {{thematic_break}} # line is a thematic beak
266270 | {{first_list_item}} # a list item begins the line
267271 | {{html_block}} # a html block begins the line
@@ -275,6 +279,7 @@ variables:
275279 | {{block_quote}} # a blockquote begins the line
276280 | {{atx_heading}} # an ATX heading begins the line
277281 | {{fenced_code_block_start}} # a fenced codeblock begins the line
282+ | {{fenced_div_block}} # a fenced div block begins the line
278283 | {{thematic_break}} # line is a thematic beak
279284 | {{list_item}} # a list item begins the line
280285 | {{html_block}} # a html block begins the line
@@ -347,6 +352,7 @@ contexts:
347352 - include : list-blocks
348353 - include : tables
349354 - include : fenced-code-blocks
355+ - include : fenced-div-blocks
350356 - include : html-blocks
351357 - include : reference-definitions
352358 - include : atx-headings
@@ -579,6 +585,7 @@ contexts:
579585 | {{reference_definition}} # a reference definition begins the line
580586 | {{atx_heading}} # an ATX heading begins the line
581587 | {{fenced_code_block_start}} # a fenced codeblock begins the line
588+ | {{fenced_div_block}} # a fenced div block begins the line
582589 | {{thematic_break}} # line is a thematic beak
583590 | {{list_item}} # a list item begins the line
584591 | {{html_block}} # a html block begins the line
@@ -690,6 +697,7 @@ contexts:
690697 (?: $ # the line is blank (or only contains whitespace)
691698 | {{atx_heading}} # an ATX heading begins the line
692699 | {{fenced_code_block_start}} # a fenced codeblock begins the line
700+ | {{fenced_div_block}} # a fenced div block begins the line
693701 | {{thematic_break}} # line is a thematic beak
694702 | {{list_item}} # a list item begins the line
695703 | {{html_block}} # a html block begins the line
@@ -717,6 +725,7 @@ contexts:
717725 (?: \s* $ # the line is blank (or only contains whitespace)
718726 | {{atx_heading}} # an ATX heading begins the line
719727 | {{fenced_code_block_start}} # a fenced codeblock begins the line
728+ | {{fenced_div_block}} # a fenced div block begins the line
720729 | {{thematic_break}} # line is a thematic beak
721730 | {{list_item}} # a list item begins the line
722731 | {{html_block}} # a html block begins the line
@@ -2249,6 +2258,7 @@ contexts:
22492258 | {{reference_definition}} # a reference definition begins the line
22502259 | {{atx_heading}} # an ATX heading begins the line
22512260 | {{fenced_code_block_start}} # a fenced codeblock begins the line
2261+ | {{fenced_div_block}} # a fenced div block begins the line
22522262 | {{thematic_break}} # line is a thematic beak
22532263 | {{list_item}} # a list item begins the line
22542264 | {{html_block}} # a html block begins the line
@@ -2364,6 +2374,7 @@ contexts:
23642374 | {{atx_heading}}
23652375 | {{block_quote}}
23662376 | {{fenced_code_block_start}}
2377+ | {{fenced_div_block}}
23672378 | {{indented_code_block}}
23682379 | {{thematic_break}}
23692380 )
@@ -3505,6 +3516,46 @@ contexts:
35053516 - include : scope:text.tex.latex#macros
35063517 - include : scope:text.tex.latex#math-content
35073518
3519+ # ##[ EXTENSIONS: PANDOC FENCED DIVS ]##########################################
3520+
3521+ fenced-div-blocks :
3522+ # https://pandoc.org/MANUAL.html#divs-and-spans
3523+ - match : ^[ \t]*({{fenced_div_block}})[ \t]*(?=\S)
3524+ captures :
3525+ 1 : punctuation.section.block.begin.markdown
3526+ push :
3527+ - fenced-div-body
3528+ - fenced-div-puncuation
3529+ - fenced-div-attr
3530+
3531+ fenced-div-attr :
3532+ - meta_include_prototype : false
3533+ - match : \{
3534+ scope : punctuation.definition.attributes.begin.markdown
3535+ set : link-def-attr-body
3536+ - match : ' {{tag_attribute_name_start}}'
3537+ set :
3538+ - tag-attr-meta
3539+ - tag-attr-equals
3540+ - tag-attr-name
3541+ - match : else-pop
3542+
3543+ fenced-div-puncuation :
3544+ - meta_include_prototype : false
3545+ - match : ' :+'
3546+ scope : punctuation.section.block.markdown
3547+ pop : 1
3548+ - include : else-pop
3549+
3550+ fenced-div-body :
3551+ - meta_include_prototype : false
3552+ - meta_scope : meta.block.div.markdown
3553+ - match : ^[ \t]*(\1)(\s*\n)
3554+ captures :
3555+ 1 : punctuation.section.block.end.markdown
3556+ pop : 1
3557+ - include : markdown
3558+
35083559# ##[ PROTOTYPES ]#############################################################
35093560
35103561 else-pop :
@@ -3523,4 +3574,3 @@ contexts:
35233574 immediately-pop :
35243575 - match : ' '
35253576 pop : 1
3526-
0 commit comments