You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Use execCommand for HTML clipboard copy in Obsidian
navigator.clipboard.write() with ClipboardItem does not reliably write
text/html in Electron's renderer process. Replace with DOMParser +
contentEditable + execCommand approach using Obsidian's preferred APIs:
- DOMParser instead of innerHTML (avoids scanner error)
- createDiv() and setCssStyles() instead of createElement/style.*
- activeDocument and activeWindow throughout
- execCommand('copy') on selected rich content (deprecated warning,
but the only reliable way to write text/html in Electron)
Fixes: formatted paste broken in all destinations (Google Docs, Word,
OneNote, Email) — pasting raw markdown instead of styled HTML.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>