Skip to content

Conversation

@CaptainCodeman
Copy link
Contributor

Uses diffhtml to patch the rendered HTML to prevent img, video, and iframe content being re-loaded on every edit.

Closes #162

@BearToCode BearToCode added the enhancement New feature or request label May 16, 2025
@BearToCode
Copy link
Owner

Hi! I like this idea, however I've tested it and it breaks the component plugin (as well as any plugin using the carta-render callback), as using a separate callback to edit the final HTML interferes with diffhtml.

Maybe there's another approach for just "recycling" the HTML for images and videos, and not everything else?

@CaptainCodeman
Copy link
Contributor Author

I haven't used either of those - TBH I thought that was the spot where the renderedHtml was written to the DOM, but I guess not?

@BearToCode
Copy link
Owner

It is, however those plugins work by manipulating the generated HTML (i.e. the one Renderer.svelte sees) every time it renders. Doing so breaks diffhtml, which would otherwise work.

I'm not really sure how this could be avoided. Maybe there's a way to sort of cache videos and images, to prevent the flickering visible in #162 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patch updates to rendered HTML

2 participants