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

Fix codegen when custom attributes have embedded newlines #873

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

asklar
Copy link
Member

@asklar asklar commented Jun 12, 2021

Fixes #818

When stamping out custom attributes, the codegen was not considering that string-typed custom attribute parameters might contain newlines. This results in invalid C# generated code.
The fix is to prepend the string with the "raw string" C# token @ so that newlines are embedded in the string as intended.

@asklar
Copy link
Member Author

asklar commented Jun 12, 2021

CC @j0shuams @Scottj1s

Copy link
Member

@Scottj1s Scottj1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Alex!

@Scottj1s Scottj1s merged commit 14f9733 into microsoft:master Jun 14, 2021
@asklar asklar deleted the newlinesInAttrs branch June 15, 2021 07:58
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.

Newlines in custom attributes generate a non-compiling projection
2 participants