I would like to append a string containing HTML fragments into a node of an existing TreeDom. In beautifulsoup, I can parse the fragments into a soup, then append it to the target node. At first, I managed to parse the fragments into a TreeDom, so the next step is to move the root node or its children to the existing tree. However, in markupever, the BaseNode.detach method has a note saying that "This method cannot be used to move a node to another tree." Apparently, there is a reparent_append() function in the Rust code with Python binding, but it requires that both the current node and the new parent belong to the same tree. As far as I know, currently, there isn't any method in markupever to achieve this.
I would like to append a string containing HTML fragments into a node of an existing TreeDom. In beautifulsoup, I can parse the fragments into a soup, then append it to the target node. At first, I managed to parse the fragments into a TreeDom, so the next step is to move the root node or its children to the existing tree. However, in markupever, the
BaseNode.detachmethod has a note saying that "This method cannot be used to move a node to another tree." Apparently, there is areparent_append()function in the Rust code with Python binding, but it requires that both the current node and the new parent belong to the same tree. As far as I know, currently, there isn't any method in markupever to achieve this.