Skip to main content

Module morph

Module morph 

Source
Expand description

Island slicing โ€” extract spark:island="name" subtrees from rendered HTML so the server can return only the changed region in effects.islands.

The slicing is byte-accurate but naive: we scan for the opening attribute and pair it with the matching close tag at the same nesting depth.

Functionsยง

slice_island
Find the inner HTML of the named spark:island="..." region. Returns Some(html_string) if found, including the whole tag including its outer attributes (so the JS runtime can morph the wrapper too).