Skip to content
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

[PORT] Fully respect the original input in a string interpolation context #2992

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

Danieladu
Copy link
Contributor

Original issue: microsoft/botbuilder-dotnet#4902
C# PR: microsoft/botbuilder-dotnet#4906

Description

Originally, the string interpolation would over escape some string or character. For example:

Expression.Parse(" `\\r\\n` ").TryEvaluate(null).value -> [CR][LF]

Expression SDK would escape "\r\n" again, and convert them into a newline.

The string interpolation should respect the original input. So, the expected result is string \r\n, but not [CR][LF]

But there are still two special cases.
One is "$" and the other one is "`". Example:

Expression.Parse(" `${12}\\${34}` ").TryEvaluate(null).value   -> 12${34}
Expression.Parse(" `\\`` ").TryEvaluate(null).value   -> ` 

@Danieladu Danieladu closed this Nov 3, 2020
@Danieladu Danieladu reopened this Nov 3, 2020
@Danieladu Danieladu marked this pull request as ready for review November 3, 2020 09:10
@Danieladu Danieladu requested a review from a team as a code owner November 3, 2020 09:10
@boydc2014 boydc2014 merged commit dd1ca9b into main Nov 3, 2020
@boydc2014 boydc2014 deleted the hond/escape branch November 3, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants