From a989374f143a885920e640296902d5bbf4fe8086 Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 8 Nov 2019 14:39:07 -1000 Subject: Add dualMarkdownPreview option --- lib/render-msg.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/render-msg.js') diff --git a/lib/render-msg.js b/lib/render-msg.js index 475965a..a29a21b 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -368,6 +368,18 @@ RenderMsg.prototype.encrypted = function (cb) { RenderMsg.prototype.markdown = function (cb) { if (this.opts.markdownSource) return this.markdownSource(this.c.text, this.c.mentions) + + if (this.opts.dualMarkdown) { + var self = this + return h('table', {style: 'width: 100%'}, h('tr', [ + h('td', {style: 'width: 50%'}, + {innerHTML: this.render.markdown(this.c.text, this.c.mentions)}), + h('td', {style: 'width: 50%'}, + {innerHTML: this.render.markdown(this.c.text, this.c.mentions, + {ssbcMd: true})}) + ])).outerHTML + } + return this.render.markdown(this.c.text, this.c.mentions) } -- cgit v1.2.3