diff options
Diffstat (limited to 'lib/render.js')
-rw-r--r-- | lib/render.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/render.js b/lib/render.js index cde359d..ed8cb1a 100644 --- a/lib/render.js +++ b/lib/render.js @@ -81,6 +81,7 @@ Render.prototype.emoji = function (emoji) { } Render.prototype.markdown = function (text, mentions) { + if (!text) return '' var mentionsObj = this._mentions = {} if (Array.isArray(mentions)) mentions.forEach(function (link) { if (!link) return @@ -89,7 +90,7 @@ Render.prototype.markdown = function (text, mentions) { else if (link.host === 'http://localhost:7777') mentionsObj[link.href] = link.link }) - var out = marked((text || '').toString(), this.markedOpts) + var out = marked(String(text), this.markedOpts) delete this._mentions return out } |