Skip to content

Commit 40b574b

Browse files
committed
Merge branch 'st4-develop'
2 parents ab1fc1c + 704a534 commit 40b574b

12 files changed

+126
-56
lines changed

.github/workflows/ci-lint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
strategy:
2626
matrix:
2727
python:
28-
- '3.3'
2928
- '3.8'
3029
arch:
3130
- 'x64'
@@ -41,6 +40,5 @@ jobs:
4140
run: pip install -r tests/requirements.txt
4241
- name: Run black
4342
run: python -m black --check .
44-
if: ${{ matrix.python == '3.8' }}
4543
- name: Run flake8
4644
run: python -m flake8

.github/workflows/ci-unit-tests.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,19 @@ on:
2020

2121
jobs:
2222
test:
23-
name: Sublime Text ${{ matrix.st_version }}
23+
name: Sublime Text ${{ matrix.st-version }}
2424
runs-on: ubuntu-18.04
2525
timeout-minutes: 15 # default is 6 hours!
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
st_version: [4]
30-
container:
31-
image: sublimetext/unittesting
32-
options: --cap-add=NET_ADMIN
33-
env:
34-
SUBLIME_TEXT_VERSION: ${{ matrix.st_version }}
29+
st-version: [4]
3530
steps:
36-
- uses: actions/checkout@v1
37-
- run: sh -e /etc/init.d/xvfb start
38-
- run: curl -OL https://raw.githubusercontent.com/SublimeText/UnitTesting/master/sbin/github.sh
39-
- run: apt-get update
40-
- run: |
41-
PATH="$HOME/.local/bin:$PATH"
42-
sh github.sh bootstrap
43-
sh github.sh install_package_control
44-
sh github.sh run_tests
31+
- uses: actions/checkout@v2
32+
- uses: SublimeText/UnitTesting/actions/setup@v1
33+
with:
34+
sublime-text-version: ${{ matrix.st-version }}
35+
- uses: SublimeText/UnitTesting/actions/run-tests@v1
36+
with:
37+
coverage: true
38+
codecov-upload: true

docs/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ with...
1010
* color schemes optimized for writing
1111
* robust syntax definitions for
1212
* Standard Markdown
13-
* Github flavoured Markdown
14-
* MultiMarkdown
13+
* [Github flavoured Markdown][GFM]
14+
* [MultiMarkdown][]
1515

1616
_See [configuration][] section to learn how to change the color scheme_.
1717

@@ -90,4 +90,6 @@ with...
9090
[AtxHeadings]: usage.md#atx-style
9191
[HeadingsLevels]: usage.md#headings-levels
9292
[SeHeadings]: usage.md#setext-style
93+
[GFM]: https://github.github.com/gfm
9394
[GFM Task]: https://github.github.com/gfm/#task-list-items-extension-
95+
[MultiMarkdown]: https://fletcherpenney.net/multimarkdown

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
"3.1.1": "messages/3.1.1.md",
3939
"3.1.2": "messages/3.1.2.md",
4040
"3.1.3": "messages/3.1.3.md",
41-
"3.1.4": "messages/3.1.4.md"
41+
"3.1.4": "messages/3.1.4.md",
42+
"3.1.5": "messages/3.1.5.md"
4243
}

messages/3.1.5.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MarkdownEditing 3.1.5 Changelog
2+
3+
Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
4+
feedback you can use [GitHub issues][issues].
5+
6+
## Bug Fixes
7+
8+
* Fix empty list item highlighted as setext heading (#699)
9+
* Fix legacy MultiMarkdown frontmatter detection (#700)
10+
* `mdc` snippet now includes trailing newline
11+
12+
## New Features
13+
14+
* Add support for syntax based folding of headings and code blocks
15+
16+
## Changes
17+
18+
[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues

snippets/Code Block (mdc).sublime-snippet

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<snippet>
22
<content><![CDATA[```${1:language}
33
${2:code}
4-
```]]></content>
4+
```
5+
6+
]]></content>
57
<tabTrigger>mdc</tabTrigger>
68
<scope>text.html.markdown - meta.frontmatter - meta.disable-markdown - meta.code-fence - markup.raw</scope>
79
<description>Markdown Codeblock</description>

syntaxes/Fold.tmPreferences

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<plist version="1.0">
3+
<dict>
4+
<key>scope</key>
5+
<string>text.html.markdown</string>
6+
<key>settings</key>
7+
<dict>
8+
<key>foldScopes</key>
9+
<array>
10+
<dict>
11+
<key>begin</key>
12+
<string>markup.heading meta.whitespace.newline - markup.quote - meta.list</string>
13+
<key>end</key>
14+
<string>markup.heading - markup.quote - meta.list</string>
15+
<key>excludeTrailingNewlines</key>
16+
<true/>
17+
</dict>
18+
<dict>
19+
<key>begin</key>
20+
<string>meta.code-fence.definition.begin</string>
21+
<key>end</key>
22+
<string>meta.code-fence.definition.end</string>
23+
<key>excludeTrailingNewlines</key>
24+
<true/>
25+
</dict>
26+
</array>
27+
</dict>
28+
</dict>
29+
</plist>

syntaxes/Markdown.sublime-syntax

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ variables:
3030
setext_heading1_end: ^[ ]{,3}(=+)[ \t]*$(\n?) # between 0 and 3 spaces, followed by at least one equal sign (setext underline can be of any length)
3131
setext_heading2_end: ^[ ]{,3}(-+)[ \t]*$(\n?) # between 0 and 3 spaces, followed by at least one hyphen (setext underline can be of any length)
3232

33-
list_setext_heading_or_paragraph: (?:[ \t]*=+|(?=[ \t]*\S)) # any number of spaces, followed by non-whitespace (consume equal signs as paragraphs may start with them)
34-
list_setext_heading_escape: ^(?=[ \t]{2,}(?:=+|-+)[ \t]*$) # two or more spaces, followed by at least one hyphen or equal sign (setext underline can be of any length)
35-
list_setext_heading1_escape: ^(?=[ \t]{2,}=+[ \t]*$) # two or more spaces, followed by at least one equal sign (setext underline can be of any length)
36-
list_setext_heading1_end: ^[ \t]{2,}(=+)[ \t]*$(\n?) # two or more spaces, followed by at least one equal sign (setext underline can be of any length)
37-
list_setext_heading2_end: ^[ \t]{2,}(-+)[ \t]*$(\n?) # two or more spaces, followed by at least one hyphen (setext underline can be of any length)
33+
list_setext_heading_or_paragraph: (?:[ \t]*=+|(?=[ \t]*\S)) # any number of spaces, followed by non-whitespace (consume equal signs as paragraphs may start with them)
34+
list_setext_heading_escape: ^(?=[ \t]{2,}(?:==+|--+)[ \t]*$) # two or more spaces, followed by at least one hyphen or equal sign (setext underline can be of any length, but ST needs at least 2 to avoid ambiguity with empty list items)
35+
list_setext_heading1_escape: ^(?=[ \t]{2,}==+[ \t]*$) # two or more spaces, followed by at least one equal sign (setext underline can be of any length, but ST needs at least 2 to avoid ambiguity with empty list items)
36+
list_setext_heading1_end: ^[ \t]{2,}(==+)[ \t]*$(\n?) # two or more spaces, followed by at least one equal sign (setext underline can be of any length, but ST needs at least 2 to avoid ambiguity with empty list items)
37+
list_setext_heading2_end: ^[ \t]{2,}(--+)[ \t]*$(\n?) # two or more spaces, followed by at least one hyphen (setext underline can be of any length, but ST needs at least 2 to avoid ambiguity with empty list items)
3838

3939
block_quote: (?:[ ]{,3}(>)[ ]?) # between 0 and 3 spaces, followed by a greater than sign, (followed by any character or the end of the line = "only care about optional space!")
4040
indented_code_block: (?:[ ]{4}|[ ]{0,3}\t) # a visual tab of width 4 consisting of 4 spaces or 0 to 3 spaces followed by 1 tab

syntaxes/MultiMarkdown.sublime-syntax

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extends: Markdown.sublime-syntax
99
first_line_match: (?i:^format:\s*complete\s*$)
1010

1111
variables:
12-
header: ([A-Za-z0-9][\w -]*)(:)
12+
header: ([A-Za-z0-9][\w -]*)((:)\s+)
1313

1414
contexts:
1515
main:
@@ -45,7 +45,8 @@ contexts:
4545
- match: ^{{header}}
4646
captures:
4747
1: meta.mapping.key.multimarkdown entity.other.attribute-name.multimarkdown
48-
2: meta.mapping.multimarkdown punctuation.separator.key-value.multimarkdown
48+
2: meta.mapping.multimarkdown
49+
3: punctuation.separator.key-value.multimarkdown
4950
embed: html-content
5051
embed_scope: meta.mapping.value.multimarkdown
5152
escape: ^(?={{header}})

tests/syntax_test_markdown.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ graph n {}
18351835

18361836
```html+php
18371837
<div></div>
1838-
|^^^ entity.name.tag.block.any.html
1838+
|^^^ entity.name.tag.block
18391839
<?php
18401840
| <- markup.raw.code-fence.html-php.markdown-gfm embedding.php meta.embedded punctuation.section.embedded.begin.php
18411841
var_dump(expression);
@@ -2087,7 +2087,7 @@ okay.
20872087
| ^^^^^^^ meta.paragraph markup.italic - meta.disable-markdown
20882088

20892089
</DIV>
2090-
| ^^^ meta.disable-markdown meta.tag.block.any.html
2090+
| ^^^ meta.disable-markdown meta.tag.block
20912091

20922092
## https://spec.commonmark.org/0.30/#example-153
20932093

@@ -2145,7 +2145,7 @@ int x = 33;
21452145
| <- meta.disable-markdown - markup.italic - punctuation
21462146
|^^^^^ meta.disable-markdown - markup.italic
21472147
</Warning>
2148-
| ^^^^^^^ meta.disable-markdown meta.tag.other.html entity.name.tag.other.html
2148+
| ^^^^^^^ meta.disable-markdown meta.tag.other entity.name.tag.other.html
21492149

21502150
## https://spec.commonmark.org/0.30/#example-164
21512151

@@ -2204,15 +2204,15 @@ int x = 33;
22042204
## https://spec.commonmark.org/0.30/#example-169
22052205

22062206
<pre language="haskell"><code>
2207-
| ^^ meta.disable-markdown meta.tag.block.any.html entity.name.tag.block.any.html
2207+
| ^^ meta.disable-markdown meta.tag.block entity.name.tag.block
22082208
import Text.HTML.TagSoup
22092209

22102210
main :: IO ()
22112211
| ^^^^^^^^^^^^ meta.disable-markdown
22122212
main = print $ parseTags tags
22132213
</code></pre>
22142214
| ^^^^^^^^^^^ meta.disable-markdown
2215-
| ^^^ meta.tag.block.any.html entity.name.tag.block.any.html
2215+
| ^^^ meta.tag.block entity.name.tag.block
22162216
okay
22172217
| <- - meta.disable-markdown
22182218

@@ -2450,22 +2450,22 @@ non-disabled markdown
24502450
<div>this is HTML until there are two blank lines
24512451
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown
24522452
still <span>HTML</span>
2453-
| ^^^^ meta.tag.inline.any.html entity.name.tag.inline.any.html
2453+
| ^^^^ meta.tag.inline entity.name.tag.inline
24542454
</div>
24552455
| ^^^^ meta.disable-markdown
24562456

24572457
non-disabled markdown
24582458
| <- - meta.disable-markdown
24592459

24602460
<pre>nested tags don't count <pre>test</pre>
2461-
| ^^^^^^ meta.disable-markdown meta.tag.block.any.html
2461+
| ^^^^^^ meta.disable-markdown meta.tag.block
24622462
non-disabled markdown
24632463
| <- - meta.disable-markdown
24642464

24652465
<div>nested tags don't count <div>test
24662466
| ^^^^^ meta.disable-markdown
24672467
</div>
2468-
| ^^^ meta.disable-markdown entity.name.tag.block.any.html
2468+
| ^^^ meta.disable-markdown entity.name.tag.block
24692469

24702470
non-disabled markdown
24712471
| <- - meta.disable-markdown
@@ -2480,7 +2480,7 @@ non-disabled markdown
24802480

24812481
<div>another</div> <span>disable</span> test
24822482
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown
2483-
| ^^^^^^ meta.tag.inline.any.html
2483+
| ^^^^^^ meta.tag.inline
24842484
disabled markdown
24852485
| <- meta.disable-markdown
24862486

@@ -5148,6 +5148,24 @@ global heading
51485148
| <- markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.setext.markdown
51495149
|^^ markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.setext.markdown
51505150

5151+
- heading
5152+
---
5153+
| <- markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.setext.markdown
5154+
|^^ markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.setext.markdown
5155+
5156+
- should not be a heading, but we can't handle it yet
5157+
--
5158+
| <- markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.setext.markdown
5159+
|^ markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.setext.markdown
5160+
5161+
- list item
5162+
-
5163+
| <- markup.list.unnumbered.markdown markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown
5164+
5165+
- list item
5166+
=
5167+
| <- markup.list.unnumbered.markdown meta.paragraph.list.markdown
5168+
51515169
## https://custom-tests/list-blocks/items-with-fenced-code-blocks-indented-by-tabs
51525170

51535171
* foo
@@ -5678,7 +5696,7 @@ blah*
56785696
| ^ punctuation.definition.raw.begin.markdown
56795697
| ^ punctuation.definition.raw.end.markdown
56805698
| ^ - punctuation
5681-
| ^^^^^^^^^^^^^^^^^^^ meta.tag.inline.a.html
5699+
| ^^^^^^^^^^^^^^^^^^^ meta.tag.inline
56825700

56835701
- list item
56845702

@@ -5939,7 +5957,7 @@ foo
59395957
## https://spec.commonmark.org/0.30/#example-344
59405958
59415959
<a href="`">`
5942-
| ^^^^^^^^^ meta.tag.inline.a
5960+
| ^^^^^^^^^ meta.tag.inline
59435961
| ^ punctuation.definition.raw.begin
59445962
59455963
| <- invalid.illegal.non-terminated.raw
@@ -6911,38 +6929,38 @@ testing__
69116929
*italic text <span>HTML element</span> end of italic text*
69126930
| <- punctuation.definition.italic
69136931
| ^ punctuation.definition.italic
6914-
| ^^^^^^ meta.tag.inline.any.html
6915-
| ^^^^^^^ meta.tag.inline.any.html
6932+
| ^^^^^^ meta.tag.inline
6933+
| ^^^^^^^ meta.tag.inline
69166934
69176935
_italic text <SPAN>HTML element</SPAN> end of italic text_
69186936
| <- punctuation.definition.italic
69196937
| ^ punctuation.definition.italic
6920-
| ^^^^^^ meta.tag.inline.any.html
6921-
| ^^^^^^^ meta.tag.inline.any.html
6938+
| ^^^^^^ meta.tag.inline
6939+
| ^^^^^^^ meta.tag.inline
69226940
69236941
**bold text <span>HTML element</span> end of bold text**
69246942
| <- punctuation.definition.bold
69256943
| ^^ punctuation.definition.bold
6926-
| ^^^^^^ meta.tag.inline.any.html
6927-
| ^^^^^^^ meta.tag.inline.any.html
6944+
| ^^^^^^ meta.tag.inline
6945+
| ^^^^^^^ meta.tag.inline
69286946
69296947
__bold text <span>HTML element</span> end of bold text__
69306948
| <- punctuation.definition.bold
69316949
| ^^ punctuation.definition.bold
6932-
| ^^^^^^ meta.tag.inline.any.html
6933-
| ^^^^^^^ meta.tag.inline.any.html
6950+
| ^^^^^^ meta.tag.inline
6951+
| ^^^^^^^ meta.tag.inline
69346952
69356953
*italic text <span>HTML element</span> end of italic text*
69366954
| <- punctuation.definition.italic
69376955
| ^ punctuation.definition.italic
6938-
| ^^^^^^ meta.tag.inline.any.html
6939-
| ^^^^^^^ meta.tag.inline.any.html
6956+
| ^^^^^^ meta.tag.inline
6957+
| ^^^^^^^ meta.tag.inline
69406958
69416959
_italic text <span>HTML element</span> end of italic text_
69426960
| <- punctuation.definition.italic
69436961
| ^ punctuation.definition.italic
6944-
| ^^^^^^ meta.tag.inline.any.html
6945-
| ^^^^^^^ meta.tag.inline.any.html
6962+
| ^^^^^^ meta.tag.inline
6963+
| ^^^^^^^ meta.tag.inline
69466964
69476965
_test <span>text_ foobar</span>
69486966
| <- punctuation

0 commit comments

Comments
 (0)