Skip to content

Commit

Permalink
fix relative url (#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
economicstudio authored and Sekhmet committed Jan 17, 2019
1 parent c8784ac commit de2cf28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/vendor/steemitHtmlReady.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +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 (!/^((#)|(\/(?!\/))|((https?:)?\/\/))/.test(url)) {
child.setAttribute('href', 'https://' + url);
}
}
}
Expand Down

0 comments on commit de2cf28

Please sign in to comment.