Skip to content

Commit 70c9d8e

Browse files
authored
Merge pull request #494 from outerbase/develop
Release: merge develop into master
2 parents 951bcb5 + b06fb85 commit 70c9d8e

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

src/components/chart/index.tsx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,8 @@ interface OuterbaseChartProps {
1515
}
1616

1717
const TextComponent = ({ value }: OuterbaseChartProps) => {
18-
let markdown = value.params.options?.text ?? "";
18+
const markdown = value.params.options?.text ?? "";
1919

20-
// Bold (**text** or __text__)
21-
markdown = markdown.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>");
22-
markdown = markdown.replace(/__(.*?)__/g, "<b>$1</b>");
23-
24-
// Italic (*text* or _text_)
25-
markdown = markdown.replace(/\*(.*?)\*/g, "<i>$1</i>");
26-
markdown = markdown.replace(/_(.*?)_/g, "<i>$1</i>");
27-
28-
// Underline (__text__)
29-
markdown = markdown.replace(/~~(.*?)~~/g, "<u>$1</u>");
30-
31-
// Line break (double space followed by a newline)
32-
markdown = markdown.replace(/ {2}\n/g, "<br>");
3320
return (
3421
<div className="h-full w-full">
3522
<p
@@ -41,11 +28,7 @@ const TextComponent = ({ value }: OuterbaseChartProps) => {
4128
}}
4229
className="flex-1 self-start text-neutral-900 dark:text-neutral-100"
4330
>
44-
<span
45-
dangerouslySetInnerHTML={{
46-
__html: markdown,
47-
}}
48-
></span>
31+
<span>{markdown}</span>
4932
</p>
5033
</div>
5134
);

0 commit comments

Comments
 (0)