Skip to content

Error: Client parser breaks when first element has attributes #23

@remarkablemark

Description

@remarkablemark

When the client parser parses an HTML string where the first element has attribute(s), this causes the regex to match an improper tag name and throw an error on this line.

Example:

// works
HTMLReactParser('<p>foo</p>');

// breaks
HTMLReactParser('<p id="bar">foo</p>');

Error thrown:

TypeError: Cannot read property 'parentNode' of undefined

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions