Skip to content

Commit

Permalink
fix: support html on headline
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Sep 12, 2024
1 parent d939733 commit 231f5fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/core/src/components/heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ export const Heading: React.FC<HeadingProps> = ({ children, label, style = {} }:
margin: 0
};


if (typeof (children) === "string") {

return (
<h1
style={{ ...style, ...headingStyles }}
dangerouslySetInnerHTML={{ __html: children.replace(/(?:\r\n|\r|\n)/g, '<br/>') }}
/>
);
}

return (
<h1 style={{ ...style, ...headingStyles }}>
{children}
Expand Down

0 comments on commit 231f5fb

Please sign in to comment.