Closed codehugger closed 6 years ago
I found a solution to this. See the answer here:
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8957
For this package the relevant line is from 1850 in Markdown Extended.tmLanguage
You'll need to override the file, see 'Overriding files from a zipped package' here: http://www.sublimetext.com/docs/3/packages.html
@willbeaufoy you were able to fix this? want to do a pr? :-)
Yes thanks, will do in the next few days.
Hhm I made a pull request but withdrew it as the fix actually removes all highlighting behaviour from underscores even if they're not prececeded by a word. This is fine for me but isn't ideal for those who use this as emphasis.
Anyone see a way to preserve the proper behaviour? My change is in my branch:
https://github.com/willbeaufoy/sublime-markdown-extended/tree/fix-underscore-highlighting
Ah some progress (code taken from the Markdown Editing package), using a negative lookbehind preserves proper markdown italic behaviour from underscores, the line now becomes:
(?<!\w)(\*|_)(?=\S)
as opposed to the original:
(\*|_)(?=\S)
and my first fix:
(\W)(\*|_)(?=\S)
It still doesn't support code like $_variable_name
or _variable_name
though so I'm still looking for a solution to this.
Bump. Any fixes?
It is very common to use in the names of variables. Is it possible to fix it so that variables names that start with or use it within the variable name are not highlighted as emphasis (italic). Example