File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34737,9 +34737,9 @@ const image_1 = __nccwpck_require__(7828);
3473734737const strings_1 = __nccwpck_require__(3063);
3473834738const hasHeader = (content) => content.match(/^#\s+/);
3473934739const cleanUp = (content) => content
34740- .replace(/^(#\s+.+[\n\s]+)\s*<picture>[.\w\W]+<\/picture>[\n\s]*/, '$1\n ')
34741- .replace(/^(#\s+.+[\n\s]+)(!\[.+]\(.*\)\n?){1,2}[\n\s]*/, '$1\n ')
34742- .replace(/^(#\s+.+[\n\s]+)(<img\s.*\/>\n?){1,2}[\n\s]*/, '$1\n ');
34740+ .replace(/^(#\s+.+[\n\s]+)\s*<picture>[.\w\W]+<\/picture>[\n\s]*/, '$1')
34741+ .replace(/^(#\s+.+[\n\s]+)(!\[.+]\(.*\)\n?){1,2}[\n\s]*/, '$1')
34742+ .replace(/^(#\s+.+[\n\s]+)(<img\s.*\/>\n?){1,2}[\n\s]*/, '$1');
3474334743const setPreview = (content, config) => {
3474434744 if (!hasHeader(content)) {
3474534745 const title = (0, strings_1.titleCase)(config.image.parameters.title);
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import { titleCase } from './strings'
55const hasHeader = ( content : string ) => content . match ( / ^ # \s + / )
66
77const cleanUp = ( content : string ) : string => content
8- . replace ( / ^ ( # \s + .+ [ \n \s ] + ) \s * < p i c t u r e > [ . \w \W ] + < \/ p i c t u r e > [ \n \s ] * / , '$1\n ' )
9- . replace ( / ^ ( # \s + .+ [ \n \s ] + ) ( ! \[ .+ ] \( .* \) \n ? ) { 1 , 2 } [ \n \s ] * / , '$1\n ' )
10- . replace ( / ^ ( # \s + .+ [ \n \s ] + ) ( < i m g \s .* \/ > \n ? ) { 1 , 2 } [ \n \s ] * / , '$1\n ' )
8+ . replace ( / ^ ( # \s + .+ [ \n \s ] + ) \s * < p i c t u r e > [ . \w \W ] + < \/ p i c t u r e > [ \n \s ] * / , '$1' )
9+ . replace ( / ^ ( # \s + .+ [ \n \s ] + ) ( ! \[ .+ ] \( .* \) \n ? ) { 1 , 2 } [ \n \s ] * / , '$1' )
10+ . replace ( / ^ ( # \s + .+ [ \n \s ] + ) ( < i m g \s .* \/ > \n ? ) { 1 , 2 } [ \n \s ] * / , '$1' )
1111
1212export const setPreview = ( content : string , config : Config ) => {
1313 if ( ! hasHeader ( content ) ) {
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ exports[`with-one-image 1`] = `
4545 <img src = " https://banners.beyondco.de/Preview%20Updater.png?theme=light& pattern=topography& style=style_2& fontSize=100px& images=code& packageManager=npm+install& packageName=TheDragonCode%2Fpreview-updater& description=Lightweight+preview+update+in+your+repository" alt = " Preview Updater" >
4646</picture >
4747
48-
4948## Usage
5049
5150Something
@@ -60,7 +59,6 @@ exports[`with-one-image-without-header 1`] = `
6059 <img src = " https://banners.beyondco.de/Preview%20Updater.png?theme=light& pattern=topography& style=style_2& fontSize=100px& images=code& packageManager=npm+install& packageName=TheDragonCode%2Fpreview-updater& description=Lightweight+preview+update+in+your+repository" alt = " Preview Updater" >
6160</picture >
6261
63-
6462## Usage
6563
6664Something
@@ -75,7 +73,6 @@ exports[`with-two-images 1`] = `
7573 <img src = " https://banners.beyondco.de/Preview%20Updater.png?theme=light& pattern=topography& style=style_2& fontSize=100px& images=code& packageManager=npm+install& packageName=TheDragonCode%2Fpreview-updater& description=Lightweight+preview+update+in+your+repository" alt = " Preview Updater" >
7674</picture >
7775
78-
7976## Usage
8077
8178Something
@@ -90,7 +87,6 @@ exports[`with-two-images-without-header 1`] = `
9087 <img src = " https://banners.beyondco.de/Preview%20Updater.png?theme=light& pattern=topography& style=style_2& fontSize=100px& images=code& packageManager=npm+install& packageName=TheDragonCode%2Fpreview-updater& description=Lightweight+preview+update+in+your+repository" alt = " Preview Updater" >
9188</picture >
9289
93-
9490## Usage
9591
9692Something
You can’t perform that action at this time.
0 commit comments