re: issue #104, added external link icon to external links

This commit is contained in:
Julian Lam
2013-07-22 15:03:33 -04:00
parent d9fa78a866
commit 712eec0872
2 changed files with 7 additions and 3 deletions

View File

@@ -389,7 +389,7 @@ body .navbar .nodebb-inline-block {
.post-signature {
color: #666;
font-size: 12px;
font-size: 12.5px;
border-top: 1px solid #ddd;
display: inline-block;

View File

@@ -147,8 +147,12 @@ var RDB = require('./redis.js'),
});
if (md.length > 0) {
var parsedContentDOM = cheerio.load(marked(md));
parsedContentDOM('a').attr('rel', 'nofollow').attr('target', '_blank');
var parsedContentDOM = cheerio.load(marked(md)),
anchorText = parsedContentDOM.text();
parsedContentDOM('a').each(function() {
this.attr('rel', 'nofollow').attr('target', '_blank');
this.append(' <i class="icon-external-link"></i>');
});
html = parsedContentDOM.html();
} else html = '<p></p>';