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

Fixed backslash removing from code exceprts #2591

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

limexp
Copy link
Contributor

@limexp limexp commented Aug 22, 2020

Backslash is not a special character in HTML, so CGI.escapeHTML kept it intact and passed into the frame_code function.
At the same time backslash is a special character for sub, so it must be escaped before using as a replacement string.

The error effect now is present in the code here https://dart.dev/codelabs/dart-cheatsheet#factory-constructors
print('I don\'t recognize $typeName');
became
print('I donescaped_code#39;t recognize $typeName');

Backslash is not a special character in HTML, so CGI.escapeHTML kept it intact and passed into the frame_code function.
At the same time backslash is a special character for sub, so it must be escaped before using as a replacement string.

The error effect now is present in the code here https://dart.dev/codelabs/dart-cheatsheet#factory-constructors
print('I don\'t recognize $typeName');
became
print('I donescaped_code#39;t recognize $typeName');
@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Aug 22, 2020
@kwalrath
Copy link
Contributor

Wow, nice catch and fix! I'm going to ask one of our DPEs to review this.

@johnpryan
Copy link
Contributor

This looks good to me. I should have put this file in site-shared, since this was taken from the flutter website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Contributor has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants