Skip to content

Commit

Permalink
refactor(sectionHeader): be able to insert html
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximiliano Forlenza committed Dec 2, 2024
1 parent 1721335 commit 5283c42
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@indec/form-builder",
"version": "3.6.1",
"version": "3.6.2",
"description": "Form builder",
"main": "index.js",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ function Introduction({introduction}) {
if (!introduction) {
return null;
}
const isHTML = /<[^>]+>/g.test(introduction);

if (isHTML) {
return (
<Typography
data-testid="introduction"
fontWeight="bold"
color="gray"
whiteSpace="pre-line"
dangerouslySetInnerHTML={{__html: introduction}}
/>
);
}

return (
<Typography data-testid="introduction" fontWeight="bold" color="gray" whiteSpace="pre-line">
{introduction}
Expand Down

0 comments on commit 5283c42

Please sign in to comment.