Skip to content

Commit 53d9594

Browse files
committed
latex support
it closes the long term issue #164
1 parent 4fa5ccd commit 53d9594

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

Syntaxes/Markdown Extended.sublime-syntax

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ contexts:
783783
scope: markup.heading.2.markdown
784784
captures:
785785
1: punctuation.definition.heading.markdown
786-
- include: latex-display
786+
787787
html_comment:
788788
- match: <!--
789789
captures:
@@ -1196,11 +1196,12 @@ contexts:
11961196
- match: ^\s*$
11971197
pop: true
11981198
- match: '^\s{0,4}([*+-]|([0-9]+)\.)(?=\s)'
1199-
captures:
1199+
captures:
12001200
1: punctuation.definition.list_item.markdown
12011201
2: punctuation.definition.list_item.number.markdown
12021202
- include: inline
12031203
raw:
1204+
- include: latex-display
12041205
- match: '(`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
12051206
scope: markup.raw.inline.markdown
12061207
captures:
@@ -1280,17 +1281,34 @@ contexts:
12801281
- include: link-ref
12811282
12821283
latex-inline:
1283-
- match: '(?=\$)'
1284+
- match: \\\$
1285+
- match: |-
1286+
(?x)
1287+
(\$)(?=\S)
1288+
(?=
1289+
(?:
1290+
\\\\
1291+
|\\\$
1292+
|[^\$]
1293+
)*?
1294+
\S\$(?:[^a-zA-Z0-9]|$)
1295+
)
1296+
scope: string.other.math.latex punctuation.definition.string.begin.latex
12841297
push:
1285-
- meta_scope: text.tex.latex
1286-
- match: '(?<=\$)'
1298+
- meta_scope: text.tex.latex meta.environment.math.latex
1299+
- include: scope:text.tex.latex#macros
1300+
- include: scope:text.tex.latex#math-content
1301+
- match: \$
1302+
scope: string.other.math.latex punctuation.definition.string.end.latex
12871303
pop: true
1288-
- include: scope:text.tex.latex
12891304
12901305
latex-display:
1291-
- match: '(?=\$\$)'
1306+
- match: \$\$
1307+
scope: string.other.math.latex punctuation.definition.string.begin.latex
12921308
push:
1293-
- meta_scope: text.tex.latex
1294-
- match: '(?<=\$\$)'
1309+
- meta_scope: text.tex.latex meta.environment.math.latex
1310+
- include: scope:text.tex.latex#macros
1311+
- include: scope:text.tex.latex#math-content
1312+
- match: \$\$
1313+
scope: string.other.math.latex punctuation.definition.string.end.latex
12951314
pop: true
1296-
- include: scope:text.tex.latex

0 commit comments

Comments
 (0)