Skip to content

[Enhancement] Allow adding HTML text to a DOM tree #12

@IoeCmcomc

Description

@IoeCmcomc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions