From 2c1323cb011dd072ae73cba3296ee51dd11d35c4 Mon Sep 17 00:00:00 2001 From: Ansgar Lin Date: Sat, 21 Apr 2018 12:49:50 +0800 Subject: [PATCH] [Refine] ignore relative path I use this plugin to fix the path error in post. However it should be possible for user to use relative path. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 59da07d..dfa238d 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ hexo.extend.filter.register('after_post_render', function(data){ // For windows style path, we replace '\' to '/'. var src = $(this).attr('src').replace('\\', '/'); if(!/http[s]*.*|\/\/.*/.test(src) && - !/^\s*\//.test(src)) { + !/^\s*\//.test(src) && !/\.\./.test(src)) { // For "about" page, the first part of "src" can't be removed. // In addition, to support multi-level local directory. var linkArray = link.split('/').filter(function(elem){