-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Unable to escape backslashes correctly #545
Comments
Good afternoon @MitchellVermaning , Thank you for this issue, and I think I did solve it. Please review the PR or take a look at the test case: |
Hi @StefH, thanks for the quick response and fix! The current output (based on the tests) seems a lot better, but it seems there the result is still not entirely correct. In
I would expect the asserted result to be Actually I think the method should, in the end, only remove the leading and trailing double quote? |
Good morning @MitchellVermaning, I think it's correct, because in the source-string, you need to escape the The purpose of the StringParser is to parse the (escaped) string + remove the leading and trailing double quote. |
But you are also escaping the string in your assertions. So this:
actually means:
and that seems incorrect to me. I mean there are definitely 2 leading slashes but only one remains. Also, it would be strange that |
Eureka ? ! It seems that just using Regex.Escape does the trick ? Can you please verify the PR / uni tests? |
Wow, looking at the PR, you've cleaned up quite a bit of code there. And the existing tests are not failing, that's great! Everything seems fine on this side. Thank you so much for the quick action. Really appreciated! |
**Describe the bug** Hello! Thank you for sharing this powerful library. Last week I have reported a bug in the Linq.Dynamic.Core package (zzzprojects/System.Linq.Dynamic.Core#545). The `DynamicExpressionParser.ParseLambda()` function was unable to escape backslashes correctly. Can you please update this package to the newest version v1.2.13. Thank you!
1. Description
Hello! Thank you for sharing this powerful library.
When I try to use the
DynamicExpressionParser.ParseLambda
-function with a string value that includes escaped backslashes, it will not parse correctly, which yields unescaped output2. Exception
There is no exception thrown. Using input
The output is:
Adding more slashes does not seem to help, for instance given this input
the following output will be shown
As you can see it seems impossible to not escape the
\a
and\n
. It would be great if you could have a look at this!3. Fiddle or Project
You can see the problem on the following dotnetfidle:
https://dotnetfiddle.net/URflOo
The text was updated successfully, but these errors were encountered: