linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
566 stars 146 forks source link

Parsing text/html fails on self-closing tags #423

Open ylebre opened 4 years ago

ylebre commented 4 years ago

Parsing an HTML snippet with self closing tags (like <br> or <meta>) produces an error.

It seems that an XML parser is used to parse HTML, but just <br> should be valid for text/html.

$rdf.parse('<p><br></p>', store, baseUrl, "text/html");

fails with XML Parsing Error: mismatched tag. Expected: </br>.

$rdf.parse('<p><br/></p>', store, baseUrl, "text/html");

works as expected.