Skip to content

Commit

Permalink
Merge pull request DesertsP#45 from eillon/patch-1
Browse files Browse the repository at this point in the history
add judge for link
  • Loading branch information
DesertsP authored May 9, 2019
2 parents 68a9190 + 9c256c2 commit bb34dde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion views/comments.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
<li class="vcard">
<div class="vhead">
<% if(comment_list[i].get('link')) { %>
<a href="<%= comment_list[i].get('link') %>" target="_blank" rel="nofollow"> <%= comment_list[i].get('nick') %></a>
<% var link = comment_list[i].get('link'); %>
<% if(link.indexOf("//") != -1) { %>
<a href="<%= link %>" target="_blank" rel="nofollow"> <%= comment_list[i].get('nick') %></a>
<% } else { %>
<a href="//<%= link %>" target="_blank" rel="nofollow"> <%= comment_list[i].get('nick') %></a>
<% } %>
<% } else { %>
<span id="nick"><%= comment_list[i].get('nick') %></span>
<% } %>
Expand Down

0 comments on commit bb34dde

Please sign in to comment.