Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Markdown] Sync with MarkdownEditing 3.1.1 #3167

Merged
Merged
17 changes: 14 additions & 3 deletions Markdown/Shell (for Markdown).sublime-syntax
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%YAML 1.2
---
name: Interactive Unix Shell
scope: source.shell.interactive.markdown
version: 2
hidden: true
Expand All @@ -8,8 +9,18 @@ extends: Packages/ShellScript/Shell-Unix-Generic.sublime-syntax

contexts:
prototype:
- meta_append: true
- meta_prepend: true
# continuation lines begin with `> `
- match: ^>(?=\s)
scope: comment.other.shell

main:
- match: ^(?=\$\s)
deathaxe marked this conversation as resolved.
Show resolved Hide resolved
push: shell-interactive
- include: statements

shell-interactive:
- match: ^\$(?=\s)
scope: comment.other.shell
- match: ^(?!\s*#).*
scope: meta.output.shell
embed: statements
escape: '{{no_escape_behind}}\n'
24 changes: 22 additions & 2 deletions Markdown/syntax_test_markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -1933,14 +1933,34 @@ unclosed_paren = (
|^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown

```shell
function foo () {
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown meta.function.shell keyword.declaration.function.shell
}
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown meta.function.shell meta.compound.shell punctuation.section.compound.end.shell

$ ls ~
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive comment.other.shell
| ^^ meta.function-call.identifier.shell variable.function.shell
| ^^ meta.function-call.arguments.shell

output.txt
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive meta.output.shell
|^^^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive meta.output.shell
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive - meta.function-call - variable
|^^^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive - meta.function-call - variable

$ ls \
> /foo/
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown comment.other.shell
|^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown

$ ls \
> /foo/
bar
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function-call
|^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function-call

function foo () {}
| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function
|^^^^^^^^^^^^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function
```
| <- meta.code-fence.definition.end.shell.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
|^^ meta.code-fence.definition.end.shell.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
Expand Down