From 23cd085f4cf52dfdd2d00b75c2370cf34508a98a Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 27 Dec 2017 14:18:30 -1000 Subject: Add codeInTextareas option --- lib/render.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/render.js') diff --git a/lib/render.js b/lib/render.js index ace346d..fd357a0 100644 --- a/lib/render.js +++ b/lib/render.js @@ -63,15 +63,15 @@ MdRenderer.prototype.mention = function (preceding, id) { } MdRenderer.prototype.code = function (code, lang, escaped) { - if (void 'TODO: check a config option') { + if (this.render.opts.codeInTextareas) { + return h('div', h('textarea', { + cols: 80, + rows: u.rows(code), + innerHTML: escaped ? code : u.escapeHTML(code) + })).outerHTML + } else { return marked.Renderer.prototype.code.call(this, code, lang, escaped) } - // render as a textarea for better line wrapping in dillo - return h('textarea', { - cols: 80, - rows: u.rows(code), - innerHTML: escaped ? code : u.escapeHTML(code) - }).outerHTML } function lexerRenderEmoji(emoji) { -- cgit v1.2.3