-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace filter: unescape backslashes #109
Comments
Mmmh good question. Is it:
|
Note: SGK correctly parses the files (the string value is as it should be, unchanged). |
Yeah the parsing itself shouldn't be changed, but should we or should we not convert newlines to |
Keep in mind that if we do that in SGK, those strings may be somewhere quite deep in some array/dictionary structure, and we'd need to check all strings. Seems quite the overhead on the context builder, where it's honestly an issue in Stencil(SwiftKit). |
Note: we also have a |
Yeah which is why I'm starting to wonder if it shouldn't be Stencil's job to do that un-escape, instead of each filter individually… |
Right, so the culprit would be this line: Anyone know what's the best way to unescape something like |
In a template, if I try:
value|replace:"\n","\\n"
The search and replace strings become
"\\n"
and"\\\\n"
respectively. I think we should un-escape these backslashes, so that users correctly can search for newlines (for example). Or is this something that we should handle in Stencil itself?The text was updated successfully, but these errors were encountered: