Better naming for this parsing function
This commit is contained in:
@ -512,15 +512,15 @@ Readability.prototype = {
|
||||
|
||||
if (src) {
|
||||
const absoluteSrc = this.toAbsoluteURI(src);
|
||||
const parseNumber = (str) => {
|
||||
const attToNumber = (str) => {
|
||||
if (!str) { return 0; }
|
||||
const res = parseNumber(str);
|
||||
const res = parseInt(str);
|
||||
if (isNaN(res)) { return 0; }
|
||||
return res
|
||||
}
|
||||
|
||||
const width = parseInt(image.getAttribute('width') || image.style.width);
|
||||
const height = parseInt(image.getAttribute('height') || image.style.height);
|
||||
const width = attToNumber(image.getAttribute('width') || image.style.width);
|
||||
const height = attToNumber(image.getAttribute('height') || image.style.height);
|
||||
|
||||
const proxySrc = this.createImageProxyUrl(absoluteSrc, width, height);
|
||||
image.setAttribute('src', proxySrc);
|
||||
|
||||
Reference in New Issue
Block a user