Skip to content

Commit 59938ad

Browse files
authored
Merge pull request #21 from MikeMcQuaid/fix_underscores_in_words
Improve handling of words with underscores.
2 parents 4ae0d35 + 692640d commit 59938ad

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Syntaxes/Markdown (GitHub Italics).tmLanguage

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>hideFromUser</key>
88
<true/>
99
<key>injectionSelector</key>
10-
<string>(L:text.html.markdown markup.italic.markdown)</string>
10+
<string>(L:text.html.markdown)</string>
1111
<key>name</key>
1212
<string>Markdown (GitHub Italics)</string>
1313
<key>patterns</key>
@@ -22,13 +22,14 @@
2222
</dict>
2323
</dict>
2424
<key>comment</key>
25-
<string>This rule matches underscores inside italics rules to catch the difference
26-
between the handling of these between the standard Markdown and GitHub's
27-
variant.</string>
25+
<string>This rule matches underscores inside words to avoid italicizing partial words
26+
(the grammar gets injected into the main Markdown grammar, so its rules have higher
27+
precedence and thus prevent the main Markdown grammar’s pattern for italic text from
28+
matching these underscores.)</string>
2829
<key>match</key>
29-
<string>(_)(?=\w)(?&lt;=\w_)</string>
30+
<string>(_)(?=\w)(?&lt;=\w)</string>
3031
<key>name</key>
31-
<string>markup.italic.markdown.github</string>
32+
<string>markup.other</string>
3233
</dict>
3334
</array>
3435
<key>scopeName</key>

0 commit comments

Comments
 (0)