Skip to content

Commit c6f8c70

Browse files
authored
Disable link rendering inside BoxEmbed content (#337)
## Description ✏️ Prevents links inside BoxEmbed content from being rendered as clickable anchors. ## Screenshot (optional) ✏️ Before: <img width="963" height="305" alt="image" src="https://github.com/user-attachments/assets/fde0f353-77b9-4f02-921a-61afef7e4120" /> After: <img width="1071" height="474" alt="image" src="https://github.com/user-attachments/assets/8b74d670-95c9-42c3-9a7c-0f348dcc72a5" /> <!-- Check out the relevant rules - https://www.ssw.com.au/rules/use-pull-request-templates-to-communicate-expectations/ - https://www.ssw.com.au/rules/rules-to-better-pull-requests - https://www.ssw.com.au/rules/write-a-good-pull-request - https://www.ssw.com.au/rules/over-the-shoulder-prs - https://www.ssw.com.au/rules/do-you-use-co-creation-patterns -->
1 parent 8faef26 commit c6f8c70

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/embeds/boxEmbed.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,19 @@ export function BoxEmbed(props: any) {
8888
const figure: string = data?.figure || "";
8989
const figurePrefix: any = data?.figurePrefix || "default";
9090

91+
const components = {
92+
...MarkdownComponentMapping,
93+
a: ({ children }: any) => <span>{children}</span>,
94+
};
95+
9196
return (
9297
<>
9398
<div className={`p-4 rounded-sm my-4 ${config.containerClass}`}>
9499
<div className="flex items-start">
95100
{config.icon}
96101
<div className={`[&_p:last-child]:mb-0 ${config.textClass ?? ""}`}>
97102
<div>
98-
<TinaMarkdown content={data.body} components={MarkdownComponentMapping} />
103+
<TinaMarkdown content={data.body} components={components} />
99104
</div>
100105
</div>
101106
</div>

0 commit comments

Comments
 (0)