Skip to content

Commit bd2eb06

Browse files
committed
Fix URL punctuation rendering
1 parent 7b87dc5 commit bd2eb06

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

webview-ui/src/components/common/MarkdownBlock.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,19 @@ const remarkUrlToLink = () => {
4242
}
4343

4444
if (cleanedMatches[i]) {
45+
const originalUrl = matches[i]
46+
const cleanedUrl = cleanedMatches[i]
47+
const removedPunctuation = originalUrl.substring(cleanedUrl.length)
48+
4549
children.push({
4650
type: "link",
47-
url: cleanedMatches[i],
48-
children: [{ type: "text", value: matches[i] }],
51+
url: cleanedUrl,
52+
children: [{ type: "text", value: cleanedUrl }],
4953
})
54+
55+
if (removedPunctuation) {
56+
children.push({ type: "text", value: removedPunctuation })
57+
}
5058
}
5159
})
5260

0 commit comments

Comments
 (0)