File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,15 @@ const fetchFromGitHub = async (graphQLQuery) => {
6565}
6666
6767const REGEX_PUBLIC_IMAGES = / h t t p s : \/ \/ g i t h u b \. c o m \/ [ a - z A - Z 0 - 9 - ] + \/ [ \w \- . ] + \/ a s s e t s \/ \d + \/ ( [ 0 - 9 a - f A - F ] { 8 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 12 } ) / g
68+ const REGEX_PUBLIC_IMAGES2 = / h t t p s : \/ \/ g i t h u b \. c o m \/ u s e r - a t t a c h m e n t s \/ a s s e t s \/ ( [ 0 - 9 a - f A - F ] { 8 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 12 } ) / g
6869const replacePrivateImage = ( markdown , html ) => {
6970 const publicMatches = new Map ( )
7071 for ( const match of markdown . matchAll ( REGEX_PUBLIC_IMAGES ) ) {
7172 publicMatches . set ( match [ 0 ] , match [ 1 ] )
7273 }
74+ for ( const match of markdown . matchAll ( REGEX_PUBLIC_IMAGES2 ) ) {
75+ publicMatches . set ( match [ 0 ] , match [ 1 ] )
76+ }
7377 for ( const match of publicMatches ) {
7478 const regexPrivateImages = new RegExp ( `https:\\/\\/private-user-images\\.githubusercontent\\.com\\/\\d+\\/\\d+-${ match [ 1 ] } \\..*?(?=")` , 'g' )
7579 html = html . replaceAll ( regexPrivateImages , match [ 0 ] )
You can’t perform that action at this time.
0 commit comments