Skip to content

XML DOM error while parsing HTML string #10

@Ayush-Rawal

Description

@Ayush-Rawal

I'm getting the error "[xmldom fatalError] end tag name: p is not match the current start tagName:undefined" while trying to parse an html string

import DOMParser from 'react-native-html-parser';
const parser = new DOMParser.DOMParser();

render(){
const parsed = parser.parseFromString(item.excerpt, 'text/html');
return <Text style={styles.ListItem_brief}>{parsed}...</Text>
}

the string being parsed is:

"

Disney Theatrical Productions and Frozen have partnered with The Actors Fund to celebrate International Women’s Day with two special events: “Women’s Day on Broadway: …
<a href="https://thewaltdisneycompany.com/disneys-frozen-partners-actors-fund-celebrate-international-womens-day/\" class="button button-more">Read More</p>\n"

img_20180129_201518 1

I apologise for the bad pic, the phone doesn't allow screenshots

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