Skip to content

Commit d090ce8

Browse files
Fix regex in cleanUp function to correctly handle <picture> tag removal
1 parent aae6e6b commit d090ce8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34739,7 +34739,7 @@ const image_1 = __nccwpck_require__(7828);
3473934739
const strings_1 = __nccwpck_require__(3063);
3474034740
const hasHeader = (content) => content.match(/^#\s+/);
3474134741
const cleanUp = (content) => content
34742-
.replace(/^(#\s+.+\n+)(\s*<picture>[.\w\W]+<\/picture>)\n?/, '$1')
34742+
.replace(/^(#\s+.+\n+)(\s*<picture>[.\w\W]+<\/picture>\n?)/, '$1')
3474334743
.replace(/^(#\s+.+\n+)(!\[.+]\(.*\)\n?){1,2}\n?/, '$1\n')
3474434744
.replace(/^(#\s+.+\n+)(<img\s.*\/>\n?){1,2}\n?/, '$1\n');
3474534745
const setPreview = (content, config) => {

src/utils/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { titleCase } from './strings'
55
const hasHeader = (content: string) => content.match(/^#\s+/)
66

77
const cleanUp = (content: string): string => content
8-
.replace(/^(#\s+.+\n+)(\s*<picture>[.\w\W]+<\/picture>)\n?/, '$1')
8+
.replace(/^(#\s+.+\n+)(\s*<picture>[.\w\W]+<\/picture>\n?)/, '$1')
99
.replace(/^(#\s+.+\n+)(!\[.+]\(.*\)\n?){1,2}\n?/, '$1\n')
1010
.replace(/^(#\s+.+\n+)(<img\s.*\/>\n?){1,2}\n?/, '$1\n')
1111

0 commit comments

Comments
 (0)