Skip to content

Commit bf0168b

Browse files
committed
Merge branch 'st3-develop' into st4-develop
2 parents 933e114 + 00af35d commit bf0168b

6 files changed

Lines changed: 206 additions & 5 deletions

File tree

Default (Linux).sublime-keymap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,27 @@
205205
]
206206
},
207207

208+
//
209+
// Auto-Pairing Highlight
210+
//
211+
212+
{ "keys": ["="], "command": "insert_snippet", "args": {"contents": "==${0:$SELECTION}=="}, "context":
213+
[
214+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
215+
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
216+
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
217+
]
218+
},
219+
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left Right 2.sublime-macro"}, "context":
220+
[
221+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
222+
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
223+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
224+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "==$", "match_all": true },
225+
{ "key": "following_text", "operator": "regex_contains", "operand": "^==", "match_all": true }
226+
]
227+
},
228+
208229
//
209230
// Auto-Pairing Strike Through
210231
//

Default (OSX).sublime-keymap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,27 @@
205205
]
206206
},
207207

208+
//
209+
// Auto-Pairing Highlight
210+
//
211+
212+
{ "keys": ["="], "command": "insert_snippet", "args": {"contents": "==${0:$SELECTION}=="}, "context":
213+
[
214+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
215+
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
216+
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
217+
]
218+
},
219+
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left Right 2.sublime-macro"}, "context":
220+
[
221+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
222+
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
223+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
224+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "==$", "match_all": true },
225+
{ "key": "following_text", "operator": "regex_contains", "operand": "^==", "match_all": true }
226+
]
227+
},
228+
208229
//
209230
// Auto-Pairing Strike Through
210231
//

Default (Windows).sublime-keymap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,27 @@
205205
]
206206
},
207207

208+
//
209+
// Auto-Pairing Highlight
210+
//
211+
212+
{ "keys": ["="], "command": "insert_snippet", "args": {"contents": "==${0:$SELECTION}=="}, "context":
213+
[
214+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
215+
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
216+
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
217+
]
218+
},
219+
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left Right 2.sublime-macro"}, "context":
220+
[
221+
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true },
222+
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
223+
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
224+
{ "key": "preceding_text", "operator": "regex_contains", "operand": "==$", "match_all": true },
225+
{ "key": "following_text", "operator": "regex_contains", "operand": "^==", "match_all": true }
226+
]
227+
},
228+
208229
//
209230
// Auto-Pairing Strike Through
210231
//

messages/next.md

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

1212
## New Features
1313

14+
* syntax highlighting for `==highlight==` emphasis (#764)
1415
* syntax highlighting for Groovy in fenced code blocks (#768)
1516

1617
## Changes

syntaxes/Markdown.sublime-syntax

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,7 @@ contexts:
32443244
emphasis:
32453245
- include: bold
32463246
- include: italic
3247+
- include: highlight
32473248
- include: strikethrough
32483249

32493250
images:
@@ -3378,6 +3379,7 @@ contexts:
33783379
scope: markup.italic.markdown punctuation.definition.italic.end.markdown
33793380
set: bold-after-bold-italic-asterisk
33803381
- include: emphasis-common
3382+
- include: highlight
33813383
- include: strikethrough
33823384

33833385
bold-after-bold-italic-asterisk:
@@ -3424,6 +3426,7 @@ contexts:
34243426
scope: markup.italic.markdown punctuation.definition.bold.end.markdown
34253427
set: italic-after-bold-italic-underscore
34263428
- include: emphasis-common
3429+
- include: highlight
34273430
- include: strikethrough
34283431

34293432
bold-after-bold-italic-underscore:
@@ -3453,6 +3456,7 @@ contexts:
34533456
bold-common:
34543457
- include: emphasis-common
34553458
- include: italic
3459+
- include: highlight
34563460
- include: strikethrough
34573461

34583462
italic:
@@ -3492,8 +3496,25 @@ contexts:
34923496
italic-common:
34933497
- include: emphasis-common
34943498
- include: bold
3499+
- include: highlight
34953500
- include: strikethrough
34963501

3502+
highlight:
3503+
- match: ==(?![=>\s]) # 2x = but no =>
3504+
scope: punctuation.definition.highlight.begin.markdown
3505+
push: highlight-content
3506+
- match: =+(?![=>\s]) # any number of = not looking like =>
3507+
3508+
highlight-content:
3509+
- meta_scope: markup.highlight.markdown
3510+
- match: ==(?!=) # 2x =
3511+
scope: punctuation.definition.highlight.end.markdown
3512+
pop: 1
3513+
- match: '[ \t]*=+'
3514+
- include: emphasis-common
3515+
- include: bold
3516+
- include: italic
3517+
34973518
strikethrough:
34983519
# https://github.github.com/gfm/#strikethrough-extension-
34993520
- match: ~~(?![~}>\s]) # 2x ~ but no ~> or ~~}
@@ -3506,7 +3527,7 @@ contexts:
35063527
- match: ~~(?:(?!~)|(?=~~}|~>)) # 2x ~ maybe followed by ~> or ~~}
35073528
scope: punctuation.definition.strikethrough.end.markdown
35083529
pop: 1
3509-
- match: ~+(?:(?!~)|(?=~~}|~>)) # any number of ~ maybe followed by ~> or ~~}
3530+
- match: '[ \t]*~+(?:(?!~)|(?=~~}|~>))' # any number of ~ maybe followed by ~> or ~~}
35103531
- include: emphasis-common
35113532
- include: bold
35123533
- include: italic
@@ -3995,7 +4016,7 @@ contexts:
39954016
- meta_scope: meta.link.inet.markdown markup.underline.link.markdown-gfm
39964017
# 1. When an autolink ends in ), we scan the entire autolink for the total
39974018
# number of parentheses. If there is a greater number of closing parentheses
3998-
# than opening ones, we dont consider the last character part of the
4019+
# than opening ones, we don’t consider the last character part of the
39994020
# autolink, in order to facilitate including an autolink inside a parenthesis
40004021
# 2. If an autolink ends in a semicolon (;), we check to see if it appears to
40014022
# resemble an entity reference; if the preceding text is & followed by one

tests/syntax_test_markdown.md

Lines changed: 119 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7269,6 +7269,117 @@ __test <span>text__ *formatted</span>*
72697269
| ^ punctuation
72707270
| ^ punctuation
72717271
7272+
# TEST: HIGHLIGHT #############################################################
7273+
7274+
__==bold highlight==__
7275+
| <- markup.bold.markdown punctuation.definition.bold.begin.markdown
7276+
|^ markup.bold.markdown - markup.highlight
7277+
| ^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.highlight.markdown
7278+
| ^^ markup.bold.markdown - markup.highlight
7279+
|^ punctuation.definition.bold.begin.markdown
7280+
| ^^ punctuation.definition.highlight.begin.markdown
7281+
| ^^ punctuation.definition.highlight.end.markdown
7282+
| ^^ punctuation.definition.bold.end.markdown
7283+
7284+
**==bold highlight==**
7285+
| <- markup.bold.markdown punctuation.definition.bold.begin.markdown
7286+
|^ markup.bold.markdown - markup.highlight
7287+
| ^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.highlight.markdown
7288+
| ^^ markup.bold.markdown - markup.highlight
7289+
|^ punctuation.definition.bold.begin.markdown
7290+
| ^^ punctuation.definition.highlight.begin.markdown
7291+
| ^^ punctuation.definition.highlight.end.markdown
7292+
| ^^ punctuation.definition.bold.end.markdown
7293+
7294+
_==italic highlight==_
7295+
| <- markup.italic.markdown punctuation.definition.italic.begin.markdown
7296+
|^^^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.highlight.markdown
7297+
| ^ markup.italic.markdown - markup.highlight
7298+
|^^ punctuation.definition.highlight.begin.markdown
7299+
| ^^ punctuation.definition.highlight.end.markdown
7300+
| ^ punctuation.definition.italic.end.markdown
7301+
7302+
*==italic highlight==*
7303+
| <- markup.italic.markdown punctuation.definition.italic.begin.markdown
7304+
|^^^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.highlight.markdown
7305+
| ^ markup.italic.markdown - markup.highlight
7306+
|^^ punctuation.definition.highlight.begin.markdown
7307+
| ^^ punctuation.definition.highlight.end.markdown
7308+
| ^ punctuation.definition.italic.end.markdown
7309+
7310+
___==bold italic highlight==___
7311+
| <- markup.bold.markdown punctuation.definition.bold.begin.markdown
7312+
|^ markup.bold.markdown - markup.italic - markup.highlight
7313+
| ^ markup.bold.markdown markup.italic.markdown - markup.highlight
7314+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.highlight.markdown
7315+
| ^ markup.bold.markdown markup.italic.markdown - markup.highlight
7316+
| ^^ markup.bold.markdown - markup.italic - markup.highlight
7317+
|^ punctuation.definition.bold.begin.markdown
7318+
| ^ punctuation.definition.italic.begin.markdown
7319+
| ^^ punctuation.definition.highlight.begin.markdown
7320+
| ^^ punctuation.definition.highlight.end.markdown
7321+
| ^ punctuation.definition.italic.end.markdown
7322+
| ^^ punctuation.definition.bold.end.markdown
7323+
7324+
***==bold italic highlight==***
7325+
| <- markup.bold.markdown punctuation.definition.bold.begin.markdown
7326+
|^ markup.bold.markdown - markup.italic - markup.highlight
7327+
| ^ markup.bold.markdown markup.italic.markdown - markup.highlight
7328+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.highlight.markdown
7329+
| ^ markup.bold.markdown markup.italic.markdown - markup.highlight
7330+
| ^^ markup.bold.markdown - markup.italic - markup.highlight
7331+
|^ punctuation.definition.bold.begin.markdown
7332+
| ^ punctuation.definition.italic.begin.markdown
7333+
| ^^ punctuation.definition.highlight.begin.markdown
7334+
| ^^ punctuation.definition.highlight.end.markdown
7335+
| ^ punctuation.definition.italic.end.markdown
7336+
| ^^ punctuation.definition.bold.end.markdown
7337+
7338+
=Hi= Hello, world!
7339+
| <- - punctuation.definition.highlight
7340+
|^^^^^^^^^^^^^^^^^ meta.paragraph - markup
7341+
| ^ - punctuation.definition.highlight
7342+
7343+
This =text==== is ====curious=.
7344+
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup
7345+
| ^ - punctuation.definition.highlight
7346+
| ^^^^ - punctuation.definition.highlight
7347+
| ^^^^ - punctuation.definition.highlight
7348+
| ^ - punctuation.definition.highlight
7349+
7350+
This ==text==== is ====curious==.
7351+
|^^^^ meta.paragraph - markup
7352+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.highlight
7353+
| ^^ meta.paragraph - markup
7354+
| ^^ punctuation.definition.highlight.begin
7355+
| ^^^^ - punctuation.definition.highlight
7356+
| ^^^^ - punctuation.definition.highlight
7357+
| ^^ punctuation.definition.highlight.end
7358+
7359+
This ==is ==highlighted== inline text
7360+
|^^^^ - markup.highlight
7361+
| ^^^^^^^^^^^^^^^^^^^^ markup.highlight.markdown
7362+
| ^^^^^^^^^^^^ - markup.highlight
7363+
7364+
This ==has a
7365+
| ^^^^^^^^ meta.paragraph markup.highlight
7366+
7367+
| <- meta.paragraph markup.highlight invalid.illegal.non-terminated.bold-italic
7368+
new paragraph==.
7369+
| ^^ meta.paragraph markup.highlight punctuation.definition.highlight.begin
7370+
7371+
| <- invalid.illegal.non-terminated.bold-italic
7372+
7373+
A ==[highlight](https://link-url)==
7374+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.highlight.markdown
7375+
7376+
A ==![highlight](https://image-url)==
7377+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.highlight.markdown
7378+
7379+
A ==[![highlight](image-url)](link-url)==
7380+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.highlight.markdown
7381+
7382+
72727383
# TEST: STRIKETHROUGH #########################################################
72737384
72747385
__~~bold striked~~__
@@ -7356,6 +7467,11 @@ This ~~text~~~~ is ~~~~curious~~.
73567467
| ^^^^ - punctuation.definition.strikethrough
73577468
| ^^ punctuation.definition.strikethrough.end
73587469
7470+
This ~~is ~~striked~~ inline text
7471+
|^^^^ - markup.strikethrough
7472+
| ^^^^^^^^^^^^^^^^ markup.strikethrough.markdown-gfm
7473+
| ^^^^^^^^^^^^^ - markup.strikethrough
7474+
73597475
This ~~has a
73607476
| ^^^^^^^^ meta.paragraph markup.strikethrough
73617477
@@ -7365,13 +7481,13 @@ new paragraph~~.
73657481
73667482
| <- invalid.illegal.non-terminated.bold-italic
73677483
7368-
A ~~[striked](https://link-url)~~
7484+
A ~~[highlight](https://link-url)~~
73697485
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.strikethrough.markdown-gfm
73707486
7371-
A ~~![striked](https://image-url)~~
7487+
A ~~![highlight](https://image-url)~~
73727488
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.strikethrough.markdown-gfm
73737489
7374-
A ~~[![striked](image-url)](link-url)~~
7490+
A ~~[![highlight](image-url)](link-url)~~
73757491
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.strikethrough.markdown-gfm
73767492
73777493

0 commit comments

Comments
 (0)