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

Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags in some situations #403

Open
lgo opened this issue Jun 8, 2024 · 0 comments

Comments

@lgo
Copy link
Contributor

lgo commented Jun 8, 2024

This is a weird one that stumped me when it happened randomly and even more once I tried writing examples that did reproduce the bug or didn't. When the comment is adjusted to no longer cause the issue, rewrap will actually reverse the effect and replace the null characters with spaces. Here's a variety of reproducing javadoc comments.

/** <p>{@link Foo} */
/** <ul>{@code Foo} */
/** <ul>{@code   Foo   } */
/** <p>{@link Foo}</p> */
/** <p><ul>{@link Foo}</p></ul> */
/** <p></p> {@link Foo}*/
/** <p></p>
 * {@link Foo}
 */

And for comparison, these do not reproduce.

/** <p>{link Foo} */
/** <p>{ } */
/** <p>{@link} */
/** <p>
 * {@link Foo}</p> */

// Yes, an extra line makes the difference on this one!
/** <p></p>
 *
 * {@link Foo}
 */

You can copy and paste those and run rewrap on the whole file.

Here's my editor information.

VSCode version info:

Version: 1.88.0 (Universal)
Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c
Date: 2024-04-03T13:28:18.899Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.5.0

Rewrap version: v1.16.3

@lgo lgo changed the title Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags on the line Jun 8, 2024
@lgo lgo changed the title Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags on the line Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags on the same line Jun 8, 2024
@lgo lgo changed the title Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags on the same line Rewrap replaces spaces with null characters inside Javadoc tags in the presence of opening HTML tags on the same line Jun 8, 2024
@lgo lgo changed the title Rewrap replaces spaces with null characters inside Javadoc tags in the presence of opening HTML tags on the same line Rewrap replaces spaces with null characters inside Javadoc tags in the presence of HTML tags in some situations Jun 8, 2024
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

No branches or pull requests

1 participant