merged conflicts. also fixed a potential issue where the external link icon would show up on internal links

v1.18.x
psychobunny 12 years ago
commit 240683ed24

@ -148,14 +148,18 @@ var RDB = require('./redis.js'),
if (md.length > 0) {
var parsedContentDOM = cheerio.load(marked(md));
parsedContentDOM('a').attr('rel', 'nofollow');
var domain = global.nconf.get('url');
var href = parsedContentDOM('a').attr('href'),
domain = global.nconf.get('url');
parsedContentDOM('a').each(function() {
this.attr('rel', 'nofollow');
var href = this.attr('href');
if (href && !href.match(domain)) {
parsedContentDOM('a').attr('href', domain + 'outgoing?' + href);
this.attr('href', domain + 'outgoing?' + href);
this.append(' <i class="icon-external-link"></i>');
}
});
html = parsedContentDOM.html();
} else {

Loading…
Cancel
Save