Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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