diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-08-08 16:43:48 -0700 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-08-09 17:32:30 -0700 |
commit | 3bb0c807560abec74794e2508ad4956f53848d77 (patch) | |
tree | 0a93b3530455c9f1c3ede03fd9a6d06ff664853a | |
parent | 7f31aec5bfb669edc62740f2ca204c47737bf327 (diff) | |
download | patchfoo-3bb0c807560abec74794e2508ad4956f53848d77.tar.gz patchfoo-3bb0c807560abec74794e2508ad4956f53848d77.zip |
Show message content warnings
-rw-r--r-- | lib/render-msg.js | 14 |
1 files changed, 12 insertions, 2 deletions
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) |