Skip to content

Commit

Permalink
Fix gfm highlighting with _ and __ (see jonschlinkert#96 and jonschli…
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiser73 committed Nov 12, 2016
1 parent 2229f7b commit 48c83e9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Syntaxes/Markdown Extended.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@ contexts:
bold:
- match: |-
(?x)
(?<=[^a-zA-Z\d\$=]|^) # (?<=\s|^) wouldn't handle punctuation
(\*\*|__)(?=\S) # Open
(?=
(
Expand Down Expand Up @@ -868,16 +869,16 @@ contexts:
)
)
)
| (?!(?<=\S)\1). # Everything besides
| (?!(?<=\S)\1(?=[^a-zA-Z\d]|$)). # Everything besides
# style closer
)++
(?<=\S)\1 # Close
(?<=\S)\1(?=[^a-zA-Z\d_]|$) # Close, (?<=\S)\1(?=\s|$) wouldn't support ponctuation
)
captures:
1: punctuation.definition.bold.markdown
push:
- meta_scope: markup.bold.markdown
- match: (?<=\S)(\1)
- match: (?<=\S)(\1)(?=[^a-zA-Z\d]|$)
captures:
1: punctuation.definition.bold.markdown
pop: true
Expand Down Expand Up @@ -1032,6 +1033,7 @@ contexts:
italic:
- match: |-
(?x)
(?<=[^a-zA-Z\d\$=]|^) # (?<=\s|^) wouldn't handle punctuation
(\*|_)(?=\S) # Open
(?=
(
Expand Down Expand Up @@ -1067,16 +1069,16 @@ contexts:
)
)
| \1\1 # Must be bold closer
| (?!(?<=\S)\1). # Everything besides
| (?!(?<=\S)\1(?=[^a-zA-Z\d]|$)). # Everything besides
# style closer
)++
(?<=\S)\1 # Close
(?<=\S)\1(?=[^a-zA-Z\d]|$) # Close, (?<=\S)\1(?=\s|$) wouldn't support ponctuation
)
captures:
1: punctuation.definition.italic.markdown
push:
- meta_scope: markup.italic.markdown
- match: (?<=\S)(\1)((?!\1)|(?=\1\1))
- match: (?<=\S)(\1)(?=[^a-zA-Z\d]|$)
captures:
1: punctuation.definition.italic.markdown
pop: true
Expand Down

0 comments on commit 48c83e9

Please sign in to comment.