From 44ee859ad60c38deae338671f4fc1b3f3d665ec9 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 14 Jan 2021 20:24:18 -0500 Subject: Truncate image alt text Reduce horizontal scrollbar --- lib/render.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/render.js b/lib/render.js index 91bd2ab..1777c88 100644 --- a/lib/render.js +++ b/lib/render.js @@ -41,6 +41,7 @@ MdRenderer.prototype.urltransform = function (href) { MdRenderer.prototype.image = function (ref, title, text) { if (ref[0] !== '&') return this.link(ref, title, text) var alt = this.render.getImageAlt(ref, text) + if (alt.length > 60) alt = alt.substr(0, 60) + '…' return (/^video:/.test(text) ? h('video', { controls: 'controls', src: this.render.toUrl(ref), -- cgit v1.2.3