From 84db306f24c12d360a9267d22bbcfb74bfbc9943 Mon Sep 17 00:00:00 2001 From: Seungwon Eugene Jeong Date: Sun, 30 Dec 2018 03:08:11 +0000 Subject: [PATCH 1/2] fix relative url --- src/client/vendor/steemitHtmlReady.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client/vendor/steemitHtmlReady.js b/src/client/vendor/steemitHtmlReady.js index f4c7ac3850..74cf05ff32 100644 --- a/src/client/vendor/steemitHtmlReady.js +++ b/src/client/vendor/steemitHtmlReady.js @@ -122,9 +122,8 @@ function link(state, child) { state.links.add(url); if (state.mutate) { // If this link is not relative, http, or https -- add https. - if (!/^[\w.-]+:(\/\/)?/.test(url)) { - child.setAttribute('href', `https://${url}`); - } + if (/^\//.test(url)) child.setAttribute('href', `https://busy.org${url}`); + else if (!/^[\w.-]+:(\/\/)?/.test(url)) child.setAttribute('href', `https://${url}`); } } } From 9989ff2e7a4ee81d700a8753c882df7743949618 Mon Sep 17 00:00:00 2001 From: Seungwon Eugene Jeong Date: Thu, 17 Jan 2019 22:40:46 +0900 Subject: [PATCH 2/2] remove busy.org hardcoding Adapted (removed steem) from https://github.com/steemit/condenser/blob/06779609ae8f7476dc39ce8d9ea50f558b6b3a18/src/shared/HtmlReady.js#L146-L148 --- src/client/vendor/steemitHtmlReady.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/vendor/steemitHtmlReady.js b/src/client/vendor/steemitHtmlReady.js index 74cf05ff32..2c4c513650 100644 --- a/src/client/vendor/steemitHtmlReady.js +++ b/src/client/vendor/steemitHtmlReady.js @@ -122,8 +122,9 @@ function link(state, child) { state.links.add(url); if (state.mutate) { // If this link is not relative, http, or https -- add https. - if (/^\//.test(url)) child.setAttribute('href', `https://busy.org${url}`); - else if (!/^[\w.-]+:(\/\/)?/.test(url)) child.setAttribute('href', `https://${url}`); + if (!/^((#)|(\/(?!\/))|((https?:)?\/\/))/.test(url)) { + child.setAttribute('href', 'https://' + url); + } } } }