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(pacmak): '*/' not escaped in JavaDocs #3104

Merged
merged 3 commits into from
Oct 28, 2021
Merged

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Oct 28, 2021

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.

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.
@rix0rrr rix0rrr requested a review from a team October 28, 2021 13:37
@rix0rrr rix0rrr self-assigned this Oct 28, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 28, 2021
@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* 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.

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

heh. true!

@nija-at nija-at added the pr/no-squash This PR should be merged instead of squash-merging it label Oct 28, 2021
@rix0rrr rix0rrr removed the pr/no-squash This PR should be merged instead of squash-merging it label Oct 28, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2021

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Oct 28, 2021
@mergify mergify bot merged commit 7ab109a into main Oct 28, 2021
@mergify mergify bot deleted the huijbers/javadoc-escaping branch October 28, 2021 16:51
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2021

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants