diff --git a/src/postTools.js b/src/postTools.js index 940c39d256..f7809f3f50 100644 --- a/src/postTools.js +++ b/src/postTools.js @@ -138,7 +138,7 @@ var RDB = require('./redis.js'), }); } - PostTools.markdownToHTML = function(md) { + PostTools.markdownToHTML = function(md, isSignature) { var marked = require('marked'), cheerio = require('cheerio'); @@ -156,7 +156,7 @@ var RDB = require('./redis.js'), if (href && !href.match(domain)) { this.attr('href', domain + 'outgoing?' + href); - this.append(' '); + if (!isSignature) this.append(' '); } }); diff --git a/src/posts.js b/src/posts.js index 1281dac132..fb39b77c90 100644 --- a/src/posts.js +++ b/src/posts.js @@ -38,7 +38,7 @@ var RDB = require('./redis.js'), post.user_rep = userData.reputation || 0; post.user_postcount = userData.postcount || 0; post.picture = userData.picture || require('gravatar').url('', {}, https=global.nconf.get('https')); - post.signature = postTools.markdownToHTML(userData.signature); + post.signature = postTools.markdownToHTML(userData.signature, true); if(post.editor !== '') { user.getUserFields(post.editor, ['username', 'userslug'], function(editorData) { diff --git a/src/routes/user.js b/src/routes/user.js index 6afd2fda41..c433814709 100644 --- a/src/routes/user.js +++ b/src/routes/user.js @@ -230,7 +230,7 @@ var user = require('./../user.js'), userData.posts = posts.filter(function(p) {return p.deleted !== "1";}); userData.isFollowing = isFollowing; - userData.signature = postTools.markdownToHTML(userData.signature); + userData.signature = postTools.markdownToHTML(userData.signature, true); res.json(userData); }); });