-
Notifications
You must be signed in to change notification settings - Fork 244
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
python: newlines in literal strings example code results in invalid syntax #2569
Closed
1 of 4 tasks
Closed
1 of 4 tasks
Labels
Comments
eladb
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Feb 14, 2021
This was referenced Feb 14, 2021
mergify bot
pushed a commit
to aws/aws-cdk
that referenced
this issue
Feb 14, 2021
Following up on #13036 with an additional instance in which rosetta fails to generate correct python code (aws/jsii#2569). Fixes #13035 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
eladb
changed the title
rosetta: newlines in literal strings example code results in invalid syntax
python: newlines in literal strings example code results in invalid syntax
Feb 14, 2021
eladb
pushed a commit
that referenced
this issue
Feb 14, 2021
…docstrings Since docstrings are now rendered inside single-quoted multiline strings to allow the docstring itself to include example code with double-quoted multiline string literals. Those are the ones produced by rosetta for python. Fixes #2569
eladb
pushed a commit
that referenced
this issue
Feb 15, 2021
…docstrings (#2571) Since docstrings are now rendered inside single-quoted multiline strings to allow the docstring itself to include example code with double-quoted multiline string literals. Those are the ones produced by rosetta for python. Fixes #2569 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
|
NovakGu
pushed a commit
to NovakGu/aws-cdk
that referenced
this issue
Feb 18, 2021
Following up on aws#13036 with an additional instance in which rosetta fails to generate correct python code (aws/jsii#2569). Fixes aws#13035 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This was referenced Mar 9, 2021
mergify bot
pushed a commit
that referenced
this issue
Nov 17, 2021
Currently code examples in dotnet lose their indentation styles because we call `trim()` on each line in the code example. We want that behavior for other types of xml docs but not for code. This PR makes code a special case that calls `trimRight()` on each line, preserving the indentation on the left. The only change in the snapshots is translating this example: ```ts docs const x = 12 + 44; const s1 = "string"; const s2 = "string \nwith new newlines"; // see #2569 const s3 = `string with new lines`; ``` to this: ``` <code>int x = 12 + 44; string s1 = "string"; string s2 = @"string with new newlines"; // see #2569 string s3 = @"string with new lines";</code> ``` --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
What is the problem?
Consider the following jsii code:
The generated python output looks like this:
Notice that the
\n
in the example code was converted to"""
pairs which should be escaped or just left as is since they are part of a string literal.This was introduced in #2419
The text was updated successfully, but these errors were encountered: