Skip to content

Commit f134770

Browse files
committed
Syntax: Separate fenced code blocks for ZSH
This commit prepares for ZSH support of ST4193+. Note: Older ST releases might no longer highlight ZSH in fenced code blocks.
1 parent 33c618d commit f134770

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

messages/3.4.0.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ feedback you can use [GitHub issues][issues].
1515

1616
- add support for journal files with date and time (#792)
1717
- add support for merge conflict marker highlighting
18-
19-
## Changes
18+
- add support for ZSH syntax highlighting in fenced code blocks (ST4200+)
2019

2120
[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues

syntaxes/Shell (for Markdown).sublime-syntax renamed to syntaxes/Bash (for Markdown).sublime-syntax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
%YAML 1.2
22
---
3-
scope: source.shell.embedded.markdown
3+
scope: source.shell.bash.embedded.markdown
44
version: 2
55
hidden: true
66

7-
extends: Packages/ShellScript/Shell-Unix-Generic.sublime-syntax
7+
extends: Packages/ShellScript/Bash.sublime-syntax
88

99
contexts:
1010
main:

syntaxes/Markdown.sublime-syntax

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,19 +2156,40 @@ contexts:
21562156
- match: |-
21572157
(?x)
21582158
{{fenced_code_block_start}}
2159-
(?i:\s*(console|bash|shell(?:-script)?|sh)|zsh)
2159+
(?i:\s*(console|bash|shell(?:-script)?|sh))
21602160
{{fenced_code_block_trailing_infostring_characters}}
21612161
captures:
21622162
0: meta.code-fence.definition.begin.markdown-gfm
21632163
2: punctuation.definition.raw.code-fence.begin.markdown
21642164
5: constant.other.language-name.markdown
21652165
6: comment.line.infostring.markdown
21662166
7: meta.fold.code-fence.begin.markdown
2167-
embed: scope:source.shell.embedded.markdown
2167+
embed: scope:source.shell.bash.embedded.markdown
21682168
embed_scope:
21692169
meta.code-fence.body.markdown-gfm
21702170
markup.raw.code-fence.shell.markdown-gfm
2171-
source.shell
2171+
source.shell.bash
2172+
escape: '{{fenced_code_block_escape}}'
2173+
escape_captures:
2174+
0: meta.code-fence.definition.end.markdown-gfm
2175+
1: punctuation.definition.raw.code-fence.end.markdown
2176+
2: meta.fold.code-fence.end.markdown
2177+
- match: |-
2178+
(?x)
2179+
{{fenced_code_block_start}}
2180+
(?i:\s*(zsh))
2181+
{{fenced_code_block_trailing_infostring_characters}}
2182+
captures:
2183+
0: meta.code-fence.definition.begin.markdown-gfm
2184+
2: punctuation.definition.raw.code-fence.begin.markdown
2185+
5: constant.other.language-name.markdown
2186+
6: comment.line.infostring.markdown
2187+
7: meta.fold.code-fence.begin.markdown
2188+
embed: scope:source.shell.zsh.embedded.markdown
2189+
embed_scope:
2190+
meta.code-fence.body.markdown-gfm
2191+
markup.raw.code-fence.shell.markdown-gfm
2192+
source.shell.zsh
21722193
escape: '{{fenced_code_block_escape}}'
21732194
escape_captures:
21742195
0: meta.code-fence.definition.end.markdown-gfm
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
%YAML 1.2
2+
---
3+
scope: source.shell.zsh.embedded.markdown
4+
version: 2
5+
hidden: true
6+
7+
extends:
8+
- Bash (for Markdown).sublime-syntax
9+
- Packages/ShellScript/Zsh.sublime-syntax

0 commit comments

Comments
 (0)