Skip to content

Commit 3b46ff4

Browse files
authored
fix: html semantic, block tag should be in block tag (#442)
* fix: html semantic, block tag should be in block tag * fix: moved check children on block or inline tag in HTML component * fix: path to hasBlockTag
1 parent f735a63 commit 3b46ff4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/blocks/Header/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,21 @@ export const HeaderBlock = (props: WithChildren<HeaderBlockFullProps>) => {
121121
>
122122
<Col sizes={titleSizes} className={b('content-inner')}>
123123
{overtitle && (
124-
<p className={b('overtitle')}>
124+
<div className={b('overtitle')}>
125125
<HTML>{overtitle}</HTML>
126-
</p>
126+
</div>
127127
)}
128128
<h1 className={b('title')}>
129129
{status}
130130
<HTML>{title}</HTML>
131131
</h1>
132132
{description && (
133-
<p className={b('description')}>
133+
<div className={b('description')}>
134134
<YFMWrapper
135135
content={description}
136136
modifiers={{constructor: true}}
137137
/>
138-
</p>
138+
</div>
139139
)}
140140
{buttons && (
141141
<div className={b('buttons')} data-qa="header-buttons">

src/components/HTML/HTML.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22

33
import {WithChildren} from '../../models';
4+
import {hasBlockTag} from '../../utils';
45

56
export interface HTMLProps {
67
children?: string;
@@ -14,7 +15,7 @@ const HTML = ({children, block = false, className, itemProp}: WithChildren<HTMLP
1415
return null;
1516
}
1617

17-
return React.createElement(block ? 'div' : 'span', {
18+
return React.createElement(block || hasBlockTag(children) ? 'div' : 'span', {
1819
dangerouslySetInnerHTML: {__html: children},
1920
className,
2021
itemProp,

0 commit comments

Comments
 (0)