diff --git a/ui/src/components/MarkdownBody.test.tsx b/ui/src/components/MarkdownBody.test.tsx
index ebbf6953cc4..f1c9f9b9eca 100644
--- a/ui/src/components/MarkdownBody.test.tsx
+++ b/ui/src/components/MarkdownBody.test.tsx
@@ -173,7 +173,7 @@ describe("MarkdownBody", () => {
]);
expect(html).toContain('href="/issues/PAP-1271"');
- expect(html).toContain("PAP-1271");
+ expect(html).toContain('PAP-1271');
expect(html).toContain("text-green-600");
});
@@ -192,4 +192,19 @@ describe("MarkdownBody", () => {
expect(html).toContain("Depends on PAP-1271");
expect(html).toContain('href="PAP-1271"');
});
+
+ it("applies wrap-friendly styles to long inline content", () => {
+ const html = renderMarkdown("averyveryveryveryveryveryveryveryveryverylongtoken");
+
+ expect(html).toContain('class="paperclip-markdown prose prose-sm min-w-0 max-w-full break-words overflow-hidden');
+ expect(html).toContain('style="overflow-wrap:anywhere;word-break:break-word"');
+ expect(html).toContain("
{
+ const html = renderMarkdown("[link](https://example.com/reallyreallyreallyreallyreallyreallyreallyreallylong)");
+
+ expect(html).toContain(' (
+
+ {paragraphChildren}
+
+ {blockquoteChildren}
+
+ ),
+ td: ({ node: _node, style: tableCellStyle, children: tableCellChildren, ...tableCellProps }) => (
+
{preChildren};
},
- a: ({ href, children: linkChildren }) => {
+ code: ({ node: _node, style: codeStyle, children: codeChildren, ...codeProps }) => (
+
+ {codeChildren}
+
+ ),
+ a: ({ href, style: linkStyle, children: linkChildren }) => {
const issueRef = linkIssueReferences ? parseIssueReferenceFromHref(href) : null;
if (issueRef) {
return (
@@ -181,14 +223,14 @@ export function MarkdownBody({
parsed.kind === "project" && "paperclip-project-mention-chip",
)}
data-mention-kind={parsed.kind}
- style={mentionChipInlineStyle(parsed)}
+ style={{ ...mergeWrapStyle(linkStyle as React.CSSProperties | undefined), ...mentionChipInlineStyle(parsed) }}
>
{linkChildren}
);
}
return (
-
+
{linkChildren}
);
@@ -213,11 +255,11 @@ export function MarkdownBody({
return (