Przeglądaj źródła

use original size

MarkusRost 3 lat temu
rodzic
commit
6f0fbcbc96
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      functions/parse_page.js

+ 1 - 0
functions/parse_page.js

@@ -359,6 +359,7 @@ function parse_page(lang, msg, content, embed, wiki, reaction, {title, contentmo
 						return ( /^(?:https?:)?\/\//.test(imgURL) && /\.(?:png|jpg|jpeg|gif)(?:\/|\?|$)/i.test(imgURL) );
 					} ).map( img => {
 						let imgURL = ( img.attribs.src?.startsWith?.( 'data:' ) ? img.attribs['data-src'] : img.attribs.src );
+						imgURL = imgURL.replace( /\/thumb(\/[\da-f]\/[\da-f]{2}\/([^\/]+))\/\d+px-\2/, '$1' ).replace( /\/scale-to-width-down\/\d+/, '' );
 						return new URL(imgURL.replace( /^(?:https?:)?\/\//, 'https://' ), wiki).href;
 					} ));
 					sectionContent.find(infoboxList.join(', ')).remove();