Skip to content

Commit b201353

Browse files
committed
fix: Wrong code block renderer when documentation contains CLRF
Fixes #368 Signed-off-by: azerr <[email protected]>
1 parent 532417b commit b201353

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/redhat/devtools/lsp4ij/features/documentation/LSPDocumentationHelper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
package com.redhat.devtools.lsp4ij.features.documentation;
1212

1313
import com.intellij.openapi.project.Project;
14+
import com.intellij.openapi.util.text.StringUtilRt;
1415
import com.intellij.psi.PsiFile;
1516
import com.redhat.devtools.lsp4ij.internal.StringUtils;
1617
import org.eclipse.lsp4j.*;
@@ -96,7 +97,7 @@ private LSPDocumentationHelper() {
9697
})
9798
.filter(Objects::nonNull)
9899
.toList();
99-
} else if (hoverContents.isRight()){
100+
} else if (hoverContents.isRight()) {
100101
MarkupContent content = hoverContents.getRight();
101102
if (isValidContent(content)) {
102103
return List.of(content);
@@ -134,7 +135,7 @@ public static String convertToHtml(@NotNull List<MarkupContent> contents,
134135
}
135136
MarkupContent content = contents.get(i);
136137
htmlBody.append(MarkupKind.MARKDOWN.equals(content.getKind()) ?
137-
MarkdownConverter.getInstance(project).toHtml(content.getValue(), file) :
138+
MarkdownConverter.getInstance(project).toHtml(StringUtilRt.convertLineSeparators(content.getValue()), file) :
138139
content.getValue());
139140
}
140141
return htmlBody.toString();

0 commit comments

Comments
 (0)