fridrich commented on code in PR #1189:
URL:
https://github.com/apache/maven-plugin-tools/pull/1189#discussion_r4294515737
##########
maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavadocInlineTagsToXhtmlConverter.java:
##########
@@ -87,6 +87,7 @@ static String toXHTML(String bodySnippet) {
String html = "<html><head></head><body>" + bodySnippet + "</body>";
// make it a valid HTML document
final Document document = Jsoup.parse(html);
document.outputSettings().syntax(Document.OutputSettings.Syntax.xml);
- return document.body().html();
+ // jsoup always inserts a newline after "-->", which later renders as
a stray space
+ return document.body().html().replace("-->\n", "-->");
Review Comment:
jsoup's pretty-printer folds a source newline after --> into a space and
then adds its own \n (foo<!-- c -->\nbar becomes foo<!-- c -->\n bar). So the
replace only removes the newline jsoup inserted, and text can't run together.
The only case it touches real content is a comment followed by a newline inside
<pre>, which seems acceptable for javadoc. prettyPrint(false) would be exact,
but it would also change formatting elsewhere.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]