From a6e8e5cb82eb3e28f9ed049d625391a7b1b9aa35 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 6 Feb 2023 11:14:53 +0100 Subject: [PATCH] Disable blockquotes height calculation for #902 --- dev/Common/Html.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dev/Common/Html.js b/dev/Common/Html.js index 94cdec7b1..7fd5e0858 100644 --- a/dev/Common/Html.js +++ b/dev/Common/Html.js @@ -14,18 +14,22 @@ const "'": ''' }, - hcont = Element.fromHTML('
'), - getRealHeight = el => { - hcont.innerHTML = el.outerHTML; - const result = hcont.clientHeight; - hcont.innerHTML = ''; - return result; - }, + // eslint-disable-next-line max-len + hcont = Element.fromHTML(''), + blockquoteSwitcher = () => { SettingsUserStore.collapseBlockquotes() && // tpl.content.querySelectorAll('blockquote').forEach(node => { [...tpl.content.querySelectorAll('blockquote')].reverse().forEach(node => { - let h = node.clientHeight || getRealHeight(node); + let h = node.scrollHeight; +/* + if (!h) { + // Attempt to get height + hcont.innerHTML = node.outerHTML; + h = hcont.scrollHeight; + hcont.innerHTML = ''; + } +*/ if (0 === h || 100 < h) { const el = Element.fromHTML('