You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The short answer is that we actually could fix this in a similar way as #12. Essentially this would extend the already existing fix.
The overall strategy would be to stop highlighting {}-formatting and %-formatting upon detection of a {%...%}. This would be in the spirit of not getting in the way, since in any string that happens to use {%...%}, chances are that neither {}-formatting nor %-formatting will be applied, so highlighting them is a visual distraction. Having said that, we will not actually try to treat {%...%} as anything special either since that involves assumptions about what kind of template we're, in fact, seeing.
We do have future plans for making it possible to configure what things will be highlighted in the strings, so I think that this is a good use-case for us to consider.
Please note that any special escaped characters will still be highlighted (unless the string is raw, in the current implementation of the highlighter prefixed by R to tell apart form regexp prefixed r). @1st1 please review my fix for this and make a release if it looks good.
Activity
1st1 commentedon Nov 6, 2015
% fand% eare highlighted because it's a valid printf-style formatting syntax. I don't think we can do something about this. @vpetrovykh?vpetrovykh commentedon Nov 6, 2015
The short answer is that we actually could fix this in a similar way as #12. Essentially this would extend the already existing fix.
The overall strategy would be to stop highlighting {}-formatting and %-formatting upon detection of a
{%...%}. This would be in the spirit of not getting in the way, since in any string that happens to use{%...%}, chances are that neither {}-formatting nor %-formatting will be applied, so highlighting them is a visual distraction. Having said that, we will not actually try to treat{%...%}as anything special either since that involves assumptions about what kind of template we're, in fact, seeing.We do have future plans for making it possible to configure what things will be highlighted in the strings, so I think that this is a good use-case for us to consider.
vpetrovykh commentedon Nov 6, 2015
Please note that any special escaped characters will still be highlighted (unless the string is raw, in the current implementation of the highlighter prefixed by
Rto tell apart form regexp prefixedr).@1st1 please review my fix for this and make a release if it looks good.
1st1 commentedon Nov 6, 2015
Should be fixed in
v0.4.43