File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,17 @@ export function matchFigureTag(content: string): string[] | null {
10
10
const matches : string [ ] = [ ] ;
11
11
const openingTag = '<figure' ;
12
12
const closingTag = '</figure>' ;
13
- let startIndex = 0 ;
14
- while ( ( startIndex = content . indexOf ( openingTag , startIndex ) ) !== - 1 ) {
13
+ let startIndex = content . indexOf ( openingTag ) ;
14
+ while ( startIndex !== - 1 ) {
15
15
const endIndex = content . indexOf ( closingTag , startIndex ) ;
16
16
if ( endIndex !== - 1 && endIndex > startIndex ) {
17
17
matches . push ( content . substring ( startIndex , endIndex + closingTag . length ) ) ;
18
- startIndex = endIndex + closingTag . length ;
18
+ startIndex = content . indexOf ( openingTag , endIndex + closingTag . length ) ;
19
19
} else {
20
20
console . error ( 'Malformed figure tag found in content' ) ;
21
21
break ;
22
22
}
23
- }
23
+ }
24
24
return matches . length > 0 ? matches : null ;
25
25
}
26
26
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ import * as DOMPurify from 'dompurify';
8
8
export const defaultOptions : RenderOption = {
9
9
[ StyleType . BLOCK ] : ( item : EmbeddedItem | EntryNode ) => {
10
10
const title = DOMPurify . sanitize ( item . title || item . uid ) ;
11
- const content_type_uid = DOMPurify . sanitize ( item . _content_type_uid || ( item . system ? item . system . content_type_uid : '' ) ) ;
12
- return `<div><p>${ title } </p><p>Content type: <span>${ content_type_uid } </span></p></div>` ;
11
+ const contentTypeUid = DOMPurify . sanitize ( item . _content_type_uid || ( item . system ? item . system . content_type_uid : '' ) ) ;
12
+ return `<div><p>${ title } </p><p>Content type: <span>${ contentTypeUid } </span></p></div>` ;
13
13
} ,
14
14
[ StyleType . INLINE ] : ( item : EmbeddedItem | EntryNode ) => {
15
15
const title = DOMPurify . sanitize ( item . title || item . uid ) ;
You can’t perform that action at this time.
0 commit comments