mirror of
https://github.com/ozavodny/obsidian-copy-inline-code-plugin.git
synced 2026-07-22 08:10:25 +00:00
Refactor copy-code-widget.ts for improved functionality
- Changed `innerHTML` to `textContent` for more accurate text copying
This commit is contained in:
parent
b8a690a4ea
commit
c0bcb91d72
1 changed files with 1 additions and 1 deletions
|
|
@ -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!`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue