From c0bcb91d72c24a690de0354d68a601b669e30cf0 Mon Sep 17 00:00:00 2001 From: Zach Date: Fri, 15 Sep 2023 14:10:30 -0400 Subject: [PATCH] Refactor copy-code-widget.ts for improved functionality - Changed `innerHTML` to `textContent` for more accurate text copying --- src/copy-code-widget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/copy-code-widget.ts b/src/copy-code-widget.ts index a5e24de..3d66d49 100644 --- a/src/copy-code-widget.ts +++ b/src/copy-code-widget.ts @@ -16,7 +16,7 @@ export class CopyWidget extends WidgetType { previousElement = previousElement.previousElementSibling } - const textToCopy = previousElement?.innerHTML + const textToCopy = previousElement?.textContent if(textToCopy) { navigator.clipboard.writeText(textToCopy) new Notice(`Copied '${textToCopy}' to clipboard!`);