Skip to content

Commit

Permalink
Merge branch 'st4-develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Nov 23, 2022
2 parents a2a58e3 + cf00a5b commit bff21d0
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 123 deletions.
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"3.1.4": "messages/3.1.4.md",
"3.1.5": "messages/3.1.5.md",
"3.1.6": "messages/3.1.6.md",
"3.1.7": "messages/3.1.7.md"
"3.1.7": "messages/3.1.7.md",
"3.1.8": "messages/3.1.8.md"
}
17 changes: 17 additions & 0 deletions messages/3.1.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# MarkdownEditing 3.1.8 Changelog

Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
feedback you can use [GitHub issues][issues].

## Bug Fixes

* Fix GFM auto-link termination
* Fix inline raw code spans highlighting
* Fix stealing focus of Goto Anything Quick Panel (#710)
* Add support for pandoc attributes in reference definitions (#712)

## New Features

## Changes

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
3 changes: 2 additions & 1 deletion plugins/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def on_after_install():

def async_worker():
bootstrap_syntax_assignments()
disable_native_markdown_package()
if int(sublime.version()) < 4132:
disable_native_markdown_package()
clear_invalid_color_schemes()
# Update bootstrap cookie.
open(bootstrapped, "w").write(BOOTSTRAP_VERSION)
Expand Down
4 changes: 3 additions & 1 deletion plugins/headings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class MdeUnsavedViewNameSetter(MdeViewEventListener):
MAX_NAME = 50

def on_modified(self):
if self.view.file_name() is not None or not self.view.settings().get("set_unsaved_view_name", True):
if self.view.file_name() is not None or not self.view.settings().get(
"set_unsaved_view_name", True
):
return

name = first_heading_text(self.view)
Expand Down
5 changes: 2 additions & 3 deletions plugins/headings/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def on_load(self):

def on_pre_save(self):
self.auto_detect_heading_style()
if self.view.settings().get("mde.auto_match_heading_hashes", False):
self.view.run_command("mde_match_heading_hashes")

def auto_detect_heading_style(self):
view = self.view
Expand All @@ -86,6 +88,3 @@ def auto_detect_heading_style(self):
view.settings().set("mde.match_heading_hashes", num_trailing / num_leading > 0.5)
else:
view.settings().erase("mde.match_heading_hashes")

if view.settings().get("mde.auto_match_heading_hashes", False):
view.run_command("mde_match_heading_hashes")
55 changes: 43 additions & 12 deletions syntaxes/Markdown.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -2654,25 +2654,44 @@ contexts:
3: punctuation.definition.reference.end.markdown
4: punctuation.separator.key-value.markdown
push:
- link-def-end
- link-def-meta
- link-def-attr
- link-def-title
- link-def-url

link-def-end:
link-def-meta:
- meta_include_prototype: false
- meta_scope: meta.link.reference.def.markdown
- include: immediately-pop

link-def-attr:
- match: \{
scope: punctuation.definition.attributes.begin.markdown
set: link-def-attr-body
- match: ^(?!\s*{)|(?=\S)
pop: true

link-def-attr-body:
- meta_scope: meta.attributes.markdown
- include: tag-attributes

link-def-title:
- match: ^(?!\s*["'(])
pop: 1
- match: (?=["'(])
set:
- expect-eol
- expect-attr-or-eol
- link-title
- match: (?=\{)
pop: true
- match: \S.+
scope: invalid.illegal.expected-eol.markdown

expect-attr-or-eol:
- match: (?=\{)
pop: true
- include: expect-eol

link-def-url:
- match: <
scope: punctuation.definition.link.begin.markdown
Expand Down Expand Up @@ -2821,20 +2840,29 @@ contexts:

code-spans:
# https://spec.commonmark.org/0.30/#code-spans
- match: (`+)(?!`)
- match: (?=`+)
branch_point: code-spans
branch:
- code-span
- no-code-span

code-span:
- match: (`+)
scope: punctuation.definition.raw.begin.markdown
push: code-span-body
set: code-span-body

code-span-body:
- meta_scope: markup.raw.inline.markdown
- match: \1(?!`)
scope: punctuation.definition.raw.end.markdown
pop: 1
- match: '`+'
- match: ^\s*$\n?
scope: invalid.illegal.non-terminated.raw.markdown
- match: \`+
- match: '{{list_paragraph_end}}'
fail: code-spans

no-code-span:
- match: \`+
pop: 1
- include: paragraph-end

###[ INLINE: EMPHASIS ]#######################################################

Expand Down Expand Up @@ -3429,6 +3457,7 @@ contexts:
scope: invalid.illegal.attribute-name.markdown

tag-attr-meta:
- meta_include_prototype: false
- meta_scope: meta.attribute-with-value.markdown
- include: immediately-pop

Expand Down Expand Up @@ -3506,6 +3535,7 @@ contexts:
- link-url-scheme-separator
# Github Flavoured Markdown
# After a valid domain, zero or more non-space non-< characters may follow
# https://github.github.com/gfm/#autolinks-extension-
- match: (?:(?:https|http|ftp)(://)|www\.)[\w-]+
captures:
1: punctuation.separator.path.markdown
Expand Down Expand Up @@ -3534,14 +3564,15 @@ contexts:
# 3. Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not
# be considered part of the autolink, though they may be included in the
# interior # of the link
- match: (?=(?:\)|(?:{{html_entity}})*)[?!.,:*_~]*[\s<])
# Note: contains some empirical (undocumented) punctuation such as ;, ', "
- match: (?=(?:\)|(?:{{html_entity}})*)[?!.,:;*_~'"]*[\s<])
pop: 1
- include: autolink-inet-common

autolink-inet-group:
- match: \)
pop: 1
- match: (?=(?:{{html_entity}})*[?!.,:*_~]*[\s<])
pop: true
- match: (?=(?:{{html_entity}})*[?!.,:;*_~'"]*[\s<])
pop: 1
- include: autolink-inet-common

Expand Down
Loading

0 comments on commit bff21d0

Please sign in to comment.