File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -121,21 +121,21 @@ export const HeaderBlock = (props: WithChildren<HeaderBlockFullProps>) => {
121121 >
122122 < Col sizes = { titleSizes } className = { b ( 'content-inner' ) } >
123123 { overtitle && (
124- < div className = { b ( 'overtitle' ) } >
124+ < p className = { b ( 'overtitle' ) } >
125125 < HTML > { overtitle } </ HTML >
126- </ div >
126+ </ p >
127127 ) }
128128 < h1 className = { b ( 'title' ) } >
129129 { status }
130130 < HTML > { title } </ HTML >
131131 </ h1 >
132132 { description && (
133- < div className = { b ( 'description' ) } >
133+ < p className = { b ( 'description' ) } >
134134 < YFMWrapper
135135 content = { description }
136136 modifiers = { { constructor : true } }
137137 />
138- </ div >
138+ </ p >
139139 ) }
140140 { buttons && (
141141 < div className = { b ( 'buttons' ) } data-qa = "header-buttons" >
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ const BLOCK_ELEMENTS = [
3838 'td' ,
3939] ;
4040
41+ const BLOCK_ELEMENTS_REGEX = `<(${ BLOCK_ELEMENTS . join ( '|' ) } )[^>]*>` ;
42+
4143export function getHeaderTag ( size : TextSize ) {
4244 switch ( size ) {
4345 case 'l' :
@@ -53,10 +55,8 @@ export function getHeaderTag(size: TextSize) {
5355}
5456
5557export function hasBlockTag ( content : string ) : boolean {
56- const blockElementRegex = `/<(${ BLOCK_ELEMENTS . join ( '|' ) } )\b[^>]*>/gi` ;
57- const blockTags = content . match ( blockElementRegex ) ;
58-
59- return Boolean ( blockTags ) ;
58+ const regex = new RegExp ( BLOCK_ELEMENTS_REGEX , 'g' ) ;
59+ return regex . test ( content ) ;
6060}
6161
6262export function getBlockKey ( block : ConstructorBlock , index : number ) {
You can’t perform that action at this time.
0 commit comments