From 3bb0c807560abec74794e2508ad4956f53848d77 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 8 Aug 2019 16:43:48 -0700 Subject: Show message content warnings --- lib/render-msg.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/render-msg.js') diff --git a/lib/render-msg.js b/lib/render-msg.js index a4f2664..92d12e2 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -136,7 +136,12 @@ RenderMsg.prototype.wrap = function (content, cb) { ), h('tr', h('td.msg-content', {colspan: 3}, this.issues(done()), - content) + this.c.contentWarning ? [ + h('details', [ + h('summary', 'Content warning: ' + mdInline(this.c.contentWarning)), + content + ]) + ] : content) )]) done(cb) } @@ -159,7 +164,12 @@ RenderMsg.prototype.wrapMini = function (content, cb) { href: this.msg.key ? this.toUrl(this.msg.key) : undefined }, htime(date)), ' '] : '', this.issues(done()), - content), + this.c.contentWarning ? [ + h('details', [ + h('summary', 'Content warning: ' + mdInline(this.c.contentWarning)), + content + ]) + ] : content), h('td.msg-right', this.actions(true)) )) done(cb) -- cgit v1.2.3