From 8c317d8bef628f5083df6bea1ab6e93fed4fcb4e Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 13 Apr 2019 18:39:53 +0800 Subject: [PATCH] Update puread files. --- src/vender/puread/adaptesite.js | 8 +++----- src/vender/puread/plugin/beautify.js | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/vender/puread/adaptesite.js b/src/vender/puread/adaptesite.js index 0a5af42a..b334df9f 100644 --- a/src/vender/puread/adaptesite.js +++ b/src/vender/puread/adaptesite.js @@ -31,17 +31,15 @@ export default class AdapteSite { * Set url */ SetURL( value ) { - /* const uri = util.getLocation( value ); // Clone util.getURI() source const name = (pathname) => { pathname = pathname != "/" && pathname.endsWith("/") ? pathname = pathname.replace( /\/$/, "" ) : pathname; return pathname.replace( /\/[%@#.~a-zA-Z0-9_-]+$|^\/$/g, "" ); }, - path = name( uri.pathname ); - this.url = `${ uri.protocol }//${ uri.hostname }${ path }/`; - */ - host_href = value; + path = name( uri.pathname ); + this.url = `${ uri.protocol }//${ uri.hostname }${ path }/`; + host_href = value; } /** diff --git a/src/vender/puread/plugin/beautify.js b/src/vender/puread/plugin/beautify.js index 879ca901..11a99988 100644 --- a/src/vender/puread/plugin/beautify.js +++ b/src/vender/puread/plugin/beautify.js @@ -350,7 +350,7 @@ function commbeautify( name, $target ) { newsrc = jianshu ? jianshu : newsrc; newsrc = sina ? sina : newsrc; //newsrc = getImgAbsolutePath( newsrc ); - if ( newsrc && !src.startsWith( 'http' ) && !src.startsWith( 'data' ) ) { + if ( newsrc && !newsrc.startsWith( 'http' ) && !newsrc.startsWith( 'data' ) ) { newsrc = getImgAbsolutePath2( newsrc, location.href ); }