File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,21 +15,8 @@ interface OuterbaseChartProps {
1515}
1616
1717const 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 ) ;
You can’t perform that action at this time.
0 commit comments