From 4237a23dabe97bfbceaaa449d37be45ac36c3334 Mon Sep 17 00:00:00 2001 From: Harshit Sahu Date: Thu, 12 Jan 2023 09:36:25 +0530 Subject: [PATCH] fix the http isse We want to add 'https' in the case that the link does not have 'http' ot 'https' already. i.e if( ! (value.startsWith('http://') || (value.startsWith('https://') ) which on simplification with De Morgans's laws wpuld lead to : if (!value.startsWith('http://') && !value.startsWith('https://')) --- src/js/coder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/coder.js b/src/js/coder.js index c87cc95..90d862f 100644 --- a/src/js/coder.js +++ b/src/js/coder.js @@ -106,7 +106,7 @@ let coder = new Vue({ }, filters: { fixURL: value => { - if (!value.startsWith('http://') || !value.startsWith('https://')) { + if (!value.startsWith('http://') && !value.startsWith('https://')) { value = `https://${value}`; } return value; @@ -195,4 +195,4 @@ let coder = new Vue({ }); } } -}); \ No newline at end of file +});