Closed ditek closed 6 years ago
I'm seeing the same problem. I keep all my notes in this file, and a normal $ appears around pricing and costs all over the place. I'm guessing this is related to the integration of LaTex changes, and that just impacted me starting this last week. I also am not able to escape the $, and only get back to normal highlighting in a file by putting in 4 of them in a row ($$$$).
Noted, I'll look into it. thanks for reporting.
edit: also, since I'm not experiencing the issue (and I restarted both ST and my mac, then restarted everything again, and received a package update notification from the GitGutter, which indicates that everything I have is the latest), it's possible that the issue isn't caused by this package, or it's caused by this package when another package is installed. If you could also do some checking on your end that would be helpful.
@jonschlinkert thanks. I added all my packages to ignored_packages except Package Control and Markdown Extended, then restarted Sublime Text (build 3126). I'm still seeing the same issue.
It looks like it the latex-inline and latex-display matches are the issue. See https://github.com/jonschlinkert/sublime-markdown-extended/blob/master/Syntaxes/Markdown%20Extended.sublime-syntax#L1282
latex-inline:
- match: '(?=\$)'
push:
- meta_scope: text.tex.latex
- match: '(?<=\$)'
pop: true
- include: scope:text.tex.latex
latex-display:
- match: '(?=\$\$)'
push:
- meta_scope: text.tex.latex
- match: '(?<=\$\$)'
pop: true
- include: scope:text.tex.latex
If I use $ $
or $$ $$
separated by spaces, I can see the syntax highlighting terminate after those blocks.
1 suggestion would be to limit the latex delimiters to just $$. That would certainly work for me, but not sure what is considered standard. I'm not sure what other constraints could be put on the regex to have it work in both use cases.
Another suggestion would be to have a settings flag to disable/enable the latex behavior.
Commit 2229f7baa0219fa6c92c620064eb06e93ed3b4bb doesn't have the issue. It was probably introduced in the Latex support commit as @sidwiesner mentioned.
I believe that this is a result of the LaTeX math inclusions in the new release (#105) (which are wonderful), but there's one corner, that seems to have been missed:
This seems to cost about $3 but I'm not 100% sure
is highlighted as:
It gets stuck in LaTeX mode after a dollar sign until it hits another one.
Ideally, $
delimited math mode would not trigger in cases like this by enforcing a second $
which doesn't have a space before it. I believe this is how it was implemented under the old LaTeX math highlighting
sorry for the delay, I started working on some fixes. I'll update this issue once I've had enough time to test for regressions
FYI, it is how I handle latex in R Markdown.
Hey all,
Just wanted to note that this issue is affecting me too. It's odd because I don't remember it doing this last year when I was writing lots of Markdown. I also speculated that it had to do with MathJax/LaTex support.
I also noticed that it isn't possible to even escape the $
. If you write \$
, it still triggers the LaTeX math environment.
Another strange thing re: dollar signs: when I type "$", and then type "$" again, it prints double. When I want to type "$x+y$", it prints "$x+y$$" and I have to delete the trailing dollar sign.
After installing Markdown Extended in Sublime Text 3 yesterday, I noticed this issue today as well. It happens with dollar signs in several instances, but not all; for example:
Screenshot included.
I'm having the same issue. I have temporarily made a new Markdown Extended.sublime-syntax
file and commented out the latex highlighting lines indicated by sidwiesner, as I don't write latex.
should be fixed by e77e917
Fix confirmed. Updated screenshot included.
Thank you!
Great fix! Does this fix still support latex highlighting between dollar signs?
Yes, only if there are no spaces before the closing dollar sign and no characters after it.
Highlighting is missed up when using Dollar $ sign even if it is escaped (\$). This only affects highlighting. This file is still rendered correctly.