Skip to content

Commit

Permalink
Syntax: Add Groovy highlighting to fenced code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Jul 23, 2024
1 parent f3b9dc3 commit a1faa62
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions messages/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ feedback you can use [GitHub issues][issues].

## New Features

* syntax highlighting for Groovy in fenced code blocks (#768)

## Changes

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
21 changes: 21 additions & 0 deletions syntaxes/Markdown.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ contexts:
- include: fenced-erlang
- include: fenced-graphviz
- include: fenced-golang
- include: fenced-groovy
- include: fenced-haskell
- include: fenced-html-php
- include: fenced-html
Expand Down Expand Up @@ -1323,6 +1324,26 @@ contexts:
1: punctuation.definition.raw.code-fence.end.markdown
2: meta.fold.code-fence.end.markdown
fenced-groovy:
- match: |-
(?x)
{{fenced_code_block_start}}
(?i:\s*(groovy))
{{fenced_code_block_trailing_infostring_characters}}
captures:
0: meta.code-fence.definition.begin.groovy.markdown-gfm
2: punctuation.definition.raw.code-fence.begin.markdown
5: constant.other.language-name.markdown
6: comment.line.infostring.markdown
7: meta.fold.code-fence.begin.markdown
embed: scope:source.groovy
embed_scope: markup.raw.code-fence.groovy.markdown-gfm
escape: '{{fenced_code_block_escape}}'
escape_captures:
0: meta.code-fence.definition.end.groovy.markdown-gfm
1: punctuation.definition.raw.code-fence.end.markdown
2: meta.fold.code-fence.end.markdown
fenced-golang:
- match: |-
(?x)
Expand Down
10 changes: 10 additions & 0 deletions tests/syntax_test_markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,16 @@ graph n {}
|^^ meta.code-fence.definition.end.graphviz.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
| ^ meta.code-fence.definition.end.graphviz.markdown-gfm meta.fold.code-fence.end - punctuation

```groovy
| ^^^^^^^ meta.code-fence.definition.begin.groovy.markdown-gfm - meta.fold
| ^ meta.code-fence.definition.begin.groovy.markdown-gfm meta.fold.code-fence.begin.markdown
| <- markup.raw.code-fence.groovy.markdown-gfm source.groovy
```
| <- meta.code-fence.definition.end.groovy.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
|^^ meta.code-fence.definition.end.groovy.markdown-gfm punctuation.definition.raw.code-fence.end.markdown
| ^ meta.code-fence.definition.end.groovy.markdown-gfm meta.fold.code-fence.end - punctuation

```haskell
|^^^^^^^^^ meta.code-fence.definition.begin - meta.fold
| ^ meta.code-fence.definition.begin meta.fold.code-fence.begin
Expand Down

0 comments on commit a1faa62

Please sign in to comment.