-
Notifications
You must be signed in to change notification settings - Fork 101
Escaping (double) backslashes in source.gfm #128
Comments
This looks like a duplicate of #127 (which was closed by the user). As mentioned in that issue, it's probable that this changed with #123, but I'm not sure if that was intended. /cc @soren-n @kevinsawicki |
Certainly looks like a duplicate of #127 alright. I note that when I try one or three backslashes on the example above, I don't get an escape. For instance, |
Yeah, you need to use four backslashes currently: #127 (comment). Again, not sure if this is intended behavior or not. |
Sorry - I didn't spot that. Four backslashes works for me too! |
Thanks for confirming! Let's leave this open until @soren-n and @kevinsawicki let us know if these changes are intended or not -- just want to make sure. 👴 ✌️ |
I think that four backslashes makes sense, however notationally inconvenient. It has to do with the levels of interpretation a snippet goes through before it ends up in your text buffer:
So the process goes as follows: The reason two backslashes used to work, was because the snippet body parser never really handled escaped characters (the escape cases were handled explicitly rather than in a generic way) this was why we had bug #60. The process could be made more notationally friendly if the snippets were stored in a custom format. Then we would have more control over how it is parsed, such as not interpreting backslashes before they are being fed to the body parser. |
I agree with @soren-n here. If there was a way where backslashes wouldn't be escaped until they actually got parsed by the snippet parser, that would make things much clearer and prevent confusing this-should-work-but-it-doesn't bugs. |
Thanks for explaining, @soren-n -- that makes sense. If we're comfortable with this change -- we should update snippets in Atom-owned packages which use the old |
Its a little awkward for making snippets for latex. |
Backlashes are no longer escaped in snippets in the latest Atom, including in safe mode.
For instance, if I place the following in snippets.cson:
I get the following in the markdown file:
Whereas previously I would have got:
I am on Arch Linux, Atom version 0.192.0-9a0c3f9
The text was updated successfully, but these errors were encountered: