From 10e11e6f62f18f5b53287958cc34c9eea73cd12d Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 20 Aug 2021 23:51:14 -0400 Subject: [PATCH] ace2_inner: Get computed style of first Element, not first Node `window.getComputedStyle()` throws if passed a non-Element Node. --- src/static/js/ace2_inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 77912057e60..6f60a96294c 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3462,7 +3462,7 @@ function Ace2Inner(editorInfo, cssManagers) { // use that for displaying the side div line number inline with the first line // of content -- This is used in ep_headings, ep_font_size etc. where the line // height is increased. - const elementStyle = window.getComputedStyle(docLine.firstChild); + const elementStyle = window.getComputedStyle(docLine.firstElementChild); const lineHeight = parseInt(elementStyle.getPropertyValue('line-height')); const marginBottom = parseInt(elementStyle.getPropertyValue('margin-bottom')); lineHeights.push(lineHeight + marginBottom);