Skip to content

Build your personal knowledge base with Trilium Notes

chore: address requested changes

Elian Doran3a7167a65dd0
diff --git a/apps/client/src/services/syntax_highlight.ts b/apps/client/src/services/syntax_highlight.ts
index b4139a7c1f..1aa9084ce4 100644
--- a/apps/client/src/services/syntax_highlight.ts
+++ b/apps/client/src/services/syntax_highlight.ts
@@ -63,6 +63,7 @@ export function applyInlineCodeCopy($inlineCode: JQuery<HTMLElement>) {
$inlineCode
.addClass("copyable-inline-code")
.attr("title", t("code_block.click_to_copy"))
+ .off("click")
.on("click", (e) => {
e.stopPropagation();
diff --git a/packages/commons/src/lib/utils.ts b/packages/commons/src/lib/utils.ts
index c243f091b9..6c87df678a 100644
--- a/packages/commons/src/lib/utils.ts
+++ b/packages/commons/src/lib/utils.ts
@@ -26,7 +26,11 @@ function getCircularReplacer() {
export function formatLogMessage(message: string | object) {
if (typeof message === "object") {
- return JSON.stringify(message, getCircularReplacer(), 4);
+ try {
+ return JSON.stringify(message, getCircularReplacer(), 4);
+ } catch (e) {
+ return message.toString();
+ }
}
return message;