File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ You can also check the
2727 filters section
2828 - Dataset browse view is now correctly displayed on mobile devices
2929 - Database-related actions are now hidden in preview mode (copy URL, share)
30+ - Chart titles in user profile are now correctly rendered
3031- Security
3132 - Added additional protection against data source URL injection
3233 - Removed feature flag for custom GraphQL endpoint
Original file line number Diff line number Diff line change @@ -69,6 +69,39 @@ export const Markdown = (
6969 ) ;
7070} ;
7171
72+ export const InlineMarkdown = ( {
73+ children,
74+ ...rest
75+ } : Omit < ComponentProps < typeof ReactMarkdown > , "components" > ) => {
76+ const inlineMarkdown = children ?. replace ( / \r ? \n | \r / g, " " ) ;
77+
78+ return (
79+ < ReactMarkdown
80+ components = { {
81+ p : ( { children } ) => < > { children } </ > ,
82+ strong : ( { children } ) => < strong > { children } </ strong > ,
83+ em : ( { children } ) => < em > { children } </ em > ,
84+ a : ( { children, href } ) => < a href = { href } > { children } </ a > ,
85+ h1 : ( ) => null ,
86+ h2 : ( ) => null ,
87+ h3 : ( ) => null ,
88+ h4 : ( ) => null ,
89+ h5 : ( ) => null ,
90+ h6 : ( ) => null ,
91+ ul : ( ) => null ,
92+ li : ( ) => null ,
93+ blockquote : ( ) => null ,
94+ code : ( { children } ) => < code > { children } </ code > ,
95+ br : ( ) => < > </ > ,
96+ } }
97+ skipHtml
98+ { ...rest }
99+ >
100+ { inlineMarkdown }
101+ </ ReactMarkdown >
102+ ) ;
103+ } ;
104+
72105const componentsInheritFonts : ComponentProps <
73106 typeof ReactMarkdown
74107> [ "components" ] = {
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import sortBy from "lodash/sortBy";
2121import NextLink from "next/link" ;
2222import { ReactNode , useMemo , useState } from "react" ;
2323
24+ import { InlineMarkdown , Markdown } from "@/components/markdown" ;
2425import { MenuActionProps } from "@/components/menu-action-item" ;
2526import { OverflowTooltip } from "@/components/overflow-tooltip" ;
2627import {
@@ -361,9 +362,13 @@ const ProfileVisualizationsRow = (props: {
361362 legacyBehavior
362363 >
363364 < Link >
364- < OverflowTooltip arrow title = { chartTitle } color = "primary.main" >
365- < Typography variant = "body3" noWrap >
366- { chartTitle }
365+ < OverflowTooltip
366+ arrow
367+ title = { < Markdown > { chartTitle } </ Markdown > }
368+ color = "primary.main"
369+ >
370+ < Typography variant = "body3" component = "p" noWrap >
371+ < InlineMarkdown > { chartTitle } </ InlineMarkdown >
367372 </ Typography >
368373 </ OverflowTooltip >
369374 </ Link >
You can’t perform that action at this time.
0 commit comments