-
Notifications
You must be signed in to change notification settings - Fork 246
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(pacmak): '*/' not escaped in JavaDocs #3104
Conversation
If any of the generated JavaDoc contains '*/', that character combination will terminate the doc comment, throwing the Java compiler for a loop. The character combination needs to be escaped. This change makes examples found in the jsii assembly render the same as sample code found in running (MarkDown) text, in doc blocks and READMEs.
@@ -80,3 +80,18 @@ export class JavaDocRenderer extends MarkdownRenderer { | |||
function collapseParaJava(x: string) { | |||
return collapsePara(x, '\n<p>\n'); | |||
} | |||
|
|||
/** | |||
* A final single-pass escape of '* /' which might otherwise end a doc comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* A final single-pass escape of '* /' which might otherwise end a doc comment. | |
* A final single-pass escape of '*/' which might otherwise end a doc comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't, right, because that would end THIS doc comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh. true!
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
If any of the generated JavaDoc contains '*/', that character combination will
terminate the doc comment, throwing the Java compiler for a loop.
The character combination needs to be escaped. This change makes examples found
in the jsii assembly render the same as sample code found in running (MarkDown)
text, in doc blocks and READMEs.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.