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!`);