Sublime Forum

How can i add language support for markdown fenced blocks?

#1

The default syntax for Markdown provides syntax highlighting for within fenced blocks for a number of languages.

How can i expand on this to add highlighting for the 3rd party languages i installed?

When the syntax definition captures fenced code info it assigns additional scope for GFM. I wasn’t able to find GFM syntax definition. This is the relevant part in the syntax:

    - match: |-
         (?x)
          {{fenced_code_block_start}}
          ((?i:vhdl|vhd))
          {{fenced_code_block_trailing_infostring_characters}}
      captures:
        0: meta.code-fence.definition.begin.python.markdown-gfm
        2: punctuation.definition.raw.code-fence.begin.markdown
        5: constant.other.language-name.markdown
      embed: scope:source.python
      embed_scope: markup.raw.code-fence.python.markdown-gfm
      escape: '{{code_fence_escape}}'
      escape_captures:
        0: meta.code-fence.definition.end.python.markdown-gfm
        1: punctuation.definition.raw.code-fence.end.markdown
0 Likes