From ce0295ca7d2822cf48907280b7c1493d42b4976c Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Fri, 12 Jul 2024 19:19:49 -0500 Subject: [PATCH] Code blocks can no longer be highlighted --- pageUpdater.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pageUpdater.js b/pageUpdater.js index 815a83c..9c707af 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -89,8 +89,8 @@ function highlighter(json, full = true) { var element = json[i] if (element.type == "element") { if (element.children.length > 0) { + var valid = true if (element.attributes) { - var valid = true for (var x in element.attributes) { var attribute = element.attributes[x] if (attribute.key == "class" && attribute.value == "value") { @@ -99,6 +99,10 @@ function highlighter(json, full = true) { } } } + + if (element.tagName == "code") { + valid = false + } if (valid) { element.children = highlighter(element.children, full)