lol-html icon indicating copy to clipboard operation
lol-html copied to clipboard

Introduce innerHTML handlers

Open nox opened this issue 4 years ago • 7 comments

Request extracted from #40. We want innerHTML handlers that allow users to modify the raw HTML of an element, similar to how they are already able to modify the element's text contents with text handlers. See this comment.

nox avatar Feb 02 '21 14:02 nox

@nox @xtuc @inikulin would there be a way for me to ask this work looked at?

It'd be really handy to have this in the htmlrewriter within workers. I'm currently looking at potentially replacing some rather unwieldy WASM code with htmlrewriter but being able to access the raw HTML within an element is a key part of it.

Should I speak with our AM?

cdloh avatar Nov 17 '21 14:11 cdloh

Bumping this (old) issue — is there a supported/recommended way to extract HTML of a node (.innerHTML and .outerHTML) with HTMLRewriter/lol-html? Or would it be advisable to switch to full DOM parsing?

alexnj avatar Nov 09 '22 22:11 alexnj

bump

janwilmake avatar Sep 03 '23 09:09 janwilmake

Until we have an innerHTML method, is there a workaround to get this from the element?

madhadron avatar Sep 29 '23 05:09 madhadron

bump

PepijnSenders avatar Nov 23 '23 21:11 PepijnSenders

would love to know if this is possible as well. it looks like it is with end_tag_handlers from this example if you build up the HTML manually https://github.com/cloudflare/lol-html/blob/master/src/rewritable_units/element.rs#L496-L537

luwes avatar Dec 23 '23 16:12 luwes