Skip to content

Html string to plain text with lines #25

@k4mr4n

Description

@k4mr4n

Hey!

I wonder how can I use this library to get the innerText of my HTML string and also preserve the new lines?

const htmlstring = `<p>hello</p><img src="..." /><p>world</p>`

const result = html5parser(htmlstring) // ??

const result = `hello
world`

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