Skip to content

Commit

Permalink
[Markdown] Simplify frontmatter punctuation scopes (#3941)
Browse files Browse the repository at this point in the history
This commit renames scopes of `---` frontmatter markers to:

   meta.frontmatter punctuation.section.frontmatter.[begin|end]

Relational
---

1. Frontmatter is not scoped `meta.block` and probably shouldn't be.
   Thus using `punctuation.section.block` seems not a perfect match 
   for scoping `---` markers.

2. `punctuation.section.block` scope is primarily used 
   to denote `{` and `}` in C like syntaxes.

3. The change intents to apply scope naming guideline which 
   uses `meta.<name> punctuation.section.<name>.[begin|end]` scheme.

4. Only few syntaxes extend punctuation scopes after `begin` or `end`.
  • Loading branch information
deathaxe authored Mar 9, 2024
1 parent 80cd18f commit 989fff8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Markdown/Markdown.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -311,25 +311,25 @@ contexts:
- match: (---)\s*(?i:(json)\s*)\n
captures:
0: meta.frontmatter.markdown
1: punctuation.section.block.begin.frontmatter.markdown
1: punctuation.section.frontmatter.begin.markdown
2: constant.other.language-name.markdown
embed: scope:source.json
embed_scope: meta.frontmatter.markdown source.json.embedded.markdown
escape: ^(---|\.{3})\s*\n # pandoc requires the remainder of the line to be blank
escape_captures:
0: meta.frontmatter.markdown
1: punctuation.section.block.end.frontmatter.markdown
1: punctuation.section.frontmatter.end.markdown
- match: (---)\s*(?i:(yaml|yml)\s*)?\n
captures:
0: meta.frontmatter.markdown
1: punctuation.section.block.begin.frontmatter.markdown
1: punctuation.section.frontmatter.begin.markdown
2: constant.other.language-name.markdown
embed: scope:source.yaml
embed_scope: meta.frontmatter.markdown source.yaml.embedded.markdown
escape: ^(---|\.{3})\s*\n # pandoc requires the remainder of the line to be blank
escape_captures:
0: meta.frontmatter.markdown
1: punctuation.section.block.end.frontmatter.markdown
1: punctuation.section.frontmatter.end.markdown

markdown:
- include: indented-code-blocks
Expand Down

0 comments on commit 989fff8

Please sign in to comment.