mirror of
https://github.com/penpot/penpot.git
synced 2026-08-10 06:48:49 +00:00
The v2-html-paste path was broken since it was introduced. The paste handler called the formatted/plain dispatcher without the selection controller, so reading `clipboardData.types` threw on every paste while the feature was enabled. The HTML branch also never forwarded the allowHTMLPaste flag to mapContentFragmentFromHTML, and that function called mapContentFragmentFromDocument() without the root node, so createNodeIterator() threw and the silent fallback always degraded the paste to plain text. Pass the selection controller through the dispatcher, forward the flag from the formatted fragment helper, and iterate the parsed document from its body. AI-assisted-by: longcat-2.0-free