aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2021-01-14 20:24:18 -0500
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2021-01-14 20:24:18 -0500
commit44ee859ad60c38deae338671f4fc1b3f3d665ec9 (patch)
treeb74397d07ba261c3c7f9a661e3c4407464dcb952
parent995c0fbf37398ddeafe6eddc7b61137090601b3a (diff)
downloadpatchfoo-44ee859ad60c38deae338671f4fc1b3f3d665ec9.tar.gz
patchfoo-44ee859ad60c38deae338671f4fc1b3f3d665ec9.zip
Truncate image alt text
Reduce horizontal scrollbar
-rw-r--r--lib/render.js1
1 files changed, 1 insertions, 0 deletions
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),