From fce0d9612a7e16c54c886301cca8bf009eadf194 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Mon, 11 Oct 2021 22:57:00 +0100 Subject: [PATCH] feat: make excerpt content non-interactive (#7) * feat: make content non-interactive Prevents link/image clicks on synopsis from taking you to their respective locations. * feat: add fallback for `inert` attribute --- js/src/forum/addSummaryExcerpt.js | 2 +- resources/less/forum/extension.less | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/forum/addSummaryExcerpt.js b/js/src/forum/addSummaryExcerpt.js index bcab11d..c4570c1 100755 --- a/js/src/forum/addSummaryExcerpt.js +++ b/js/src/forum/addSummaryExcerpt.js @@ -35,7 +35,7 @@ export default function addSummaryExcerpt() { if (excerptPost) { const excerpt = ( -
+
{richExcerpt ? m.trust(truncate(excerptPost.contentHtml(), excerptLength)) : truncate(excerptPost.contentPlain(), excerptLength)}
); diff --git a/resources/less/forum/extension.less b/resources/less/forum/extension.less index 59186c5..2a50da1 100644 --- a/resources/less/forum/extension.less +++ b/resources/less/forum/extension.less @@ -7,6 +7,10 @@ color: @muted-more-color; display: block; + // Fallback for `inert` HTML attribute + // Prevents interactivity with items within the excerpt + pointer-events: none; + img { max-width: 100% }