From dab554d81945123ab0edd33e37be35e868cbb9f3 Mon Sep 17 00:00:00 2001 From: Nick Grosenbacher Date: Mon, 3 Jun 2024 15:45:08 -0400 Subject: [PATCH] SWC-6857 - Add try-catch to call to `highlightAuto` --- .../org/sagebionetworks/web/client/MarkdownItImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sagebionetworks/web/client/MarkdownItImpl.java b/src/main/java/org/sagebionetworks/web/client/MarkdownItImpl.java index 0bc457f939..150915894c 100644 --- a/src/main/java/org/sagebionetworks/web/client/MarkdownItImpl.java +++ b/src/main/java/org/sagebionetworks/web/client/MarkdownItImpl.java @@ -42,8 +42,12 @@ private static final native String _markdown2Html( console.error(_err); } } else { - return $wnd.hljs.highlightAuto(str).value; - } + try { + return $wnd.hljs.highlightAuto(str).value; + } catch (_err) { + console.error(_err); + } + } return ''; // use external highlight } });