File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34739,9 +34739,9 @@ const image_1 = __nccwpck_require__(7828);
3473934739const strings_1 = __nccwpck_require__(3063);
3474034740const hasHeader = (content) => content.match(/^#\s+/);
3474134741const cleanUp = (content) => content
34742- .replace(/^(#\s+.+\n+)( \s*<picture>[.\w\W]+<\/picture>\n?) /, '$1')
34743- .replace(/^(#\s+.+\n+)(!\[.+]\(.*\)\n?){1,2}\n? /, '$1\n')
34744- .replace(/^(#\s+.+\n+)(<img\s.*\/>\n?){1,2}\n? /, '$1\n');
34742+ .replace(/^(#\s+.+\n+)\s*<picture>[.\w\W]+<\/picture>[\n\s]* /, '$1')
34743+ .replace(/^(#\s+.+\n+)(!\[.+]\(.*\)\n?){1,2}[\n\s]* /, '$1\n')
34744+ .replace(/^(#\s+.+\n+)(<img\s.*\/>\n?){1,2}[\n\s]* /, '$1\n');
3474534745const setPreview = (content, config) => {
3474634746 if (!hasHeader(content)) {
3474734747 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 * < p i c t u r e > [ . \w \W ] + < \/ p i c t u r e > \n ? ) / , '$1' )
9- . replace ( / ^ ( # \s + .+ \n + ) ( ! \[ .+ ] \( .* \) \n ? ) { 1 , 2 } \n ? / , '$1\n' )
10- . replace ( / ^ ( # \s + .+ \n + ) ( < i m g \s .* \/ > \n ? ) { 1 , 2 } \n ? / , '$1\n' )
8+ . replace ( / ^ ( # \s + .+ \n + ) \s * < p i c t u r e > [ . \w \W ] + < \/ p i c t u r e > [ \n \s ] * / , '$1' )
9+ . replace ( / ^ ( # \s + .+ \n + ) ( ! \[ .+ ] \( .* \) \n ? ) { 1 , 2 } [ \n \s ] * / , '$1\n' )
10+ . replace ( / ^ ( # \s + .+ \n + ) ( < i m g \s .* \/ > \n ? ) { 1 , 2 } [ \n \s ] * / , '$1\n' )
1111
1212export const setPreview = ( content : string , config : Config ) => {
1313 if ( ! hasHeader ( content ) ) {
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ exports[`html-tag 1`] = `
1919 <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" >
2020</picture >
2121
22-
2322## Usage
2423
2524Something
You can’t perform that action at this time.
0 commit comments