Skip to content

Some HTML is parsed incorrectly #53

Closed
@shonfeder

Description

@shonfeder

I hit this while working on transforming Omd to Tyxml (noted here ocaml-community/omd#211 (comment)).

It looks like Lambdasoup is giving invalid results for some HTML. E.g.

# let parsed = Soup.parse {|<p><a href="foo\nbar"></p>
|};;
val parsed : Soup.soup Soup.node = <abstr>
# Soup.to_string parsed;;
- : string = "<p><a href=\"foo\\nbar\"></a></p><a href=\"foo\\nbar\">\n</a>"

If the newline in the href attribute is removed, the duplication doesn't occur.

I'm happy to put in some work towards a fix, if that would be useful.

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