From 989fff810cb84b9d8ce32f9d23a4afc670a49959 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 9 Mar 2024 17:36:21 +0100 Subject: [PATCH] [Markdown] Simplify frontmatter punctuation scopes (#3941) 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. punctuation.section..[begin|end]` scheme. 4. Only few syntaxes extend punctuation scopes after `begin` or `end`. --- Markdown/Markdown.sublime-syntax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Markdown/Markdown.sublime-syntax b/Markdown/Markdown.sublime-syntax index fee152ec7c..77ae7a5a85 100644 --- a/Markdown/Markdown.sublime-syntax +++ b/Markdown/Markdown.sublime-syntax @@ -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