Skip to content

Conversation

TrySound
Copy link
Member

@TrySound TrySound commented May 5, 2025

Ref #4404

Slightly reworked paste story. Now minimal API to insert html looks like this

const fragment = generateFragmentFromHtml(html);
insertWebstudioFragmentAt(fragment);
  • attributes are casted to string, number and boolean types
  • text is wrapped with spans when outside of rich text
  • unsupported tags are ignored in result
paste-html-preview-2.mp4

Ref #4404

Slightly reworked paste story. Now minimal API to insert html looks like
this

```js
const fragment = generateFragmentFromHtml(html);
insertWebstudioFragmentAt(fragment);
```

- attributes are casted to string, number and boolean types
- text is wrapped with spans when outside of rich text
- unsupported tags are ignored in result
@TrySound TrySound requested review from istarkov and kof May 5, 2025 14:07
@TrySound TrySound merged commit 59b6471 into main May 6, 2025
17 checks passed
@TrySound TrySound deleted the paste-html branch May 6, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants