Use createContextualFragment instead of innerHTML for Pursx
mikesol opened this issue · comments
Description
Pursx currently fails in certain situations because of the hacky way it is attached to an ad hoc span
parent. For example, if the child is an invalid child of a span
(ie a tr
) it won't work.
A separate but related issue (bundling it into this one) is that nesting of dyn
and fixed
pursx fails in certain situations. It certainly fails in these situations (as the bug was originally reported when using fixed
), but it also may fail in others.
Solution
Use createContextualFragment
.
Steps to fix
[] In makePursx_
, use a comment as a placeholder instead of a span
.
[] In makePursx_
, replace the comment by a dom fragment created via createContextualFragment
.
[] In attributeParent
, make sure that parent/child relationships for nested pursx are handled correctly.
Closing as there is currently a pursx-htmlparse2
branch that will use htmlparse2
to smooth over this & other rough edges in the pursx implementation.