iabudiab / HTMLKit

An Objective-C framework for your everyday HTML needs.
MIT License
239 stars 27 forks source link

some tags in XHTML are not closed after being parsed #34

Open ecarnevale opened 5 years ago

ecarnevale commented 5 years ago

When I parse an XHTML, I discovered that the tags in the are not being closed:

<head>
 <title>page</title>
 <meta charset="utf-8"></meta>
<link href="css/template.css" rel="stylesheet" type="text/css"></link>
</head>

the innerHTML returns:

<head>
 <title>page</title>
 <meta charset="utf-8">
<link href="css/template.css" rel="stylesheet" type="text/css">
</head>

and for example if I query [document querySelector:@"link"].outerHTML I get <link href="css/template.css" rel="stylesheet" type="text/css">

[document querySelector:@"meta"].innerHTML <object returned empty description>

[document querySelector:@"meta"].outerHTML <meta charset="utf-8">

Title is correct, though. My XHTML is not valid anymore and the Webview fails parsing it. Is there a way to avoid this loss of information? thanks!