-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<style> tags trigger \RuntimeException when CSS is wrapped in HTML comment #62
Comments
Hmm good catch, had to look it up and it's still allowed. Also this is not something that could be easily fixed as it's something inside @voku's simple HTML DOM package. |
There're a lot of packages involved and I'm not familiar with any of them. But, after some debugging, I suspect it's really a bug in that other library, simple_html_dom. Perhaps I should report it to them. The exception is thrown at // $compressedInnerHtml is like '<!--form{position:...'
$element->innerhtml = $compressedInnerHtml; In e.g. JavaScript this seems totally correct: document.createElement("div").innerHTML = "<!--form{position:..." This is the check that fails: $tmpDomString = $this->normalizeStringForComparision($newDocument);
$tmpStr = $this->normalizeStringForComparision($string);
if ($tmpDomString !== $tmpStr) {
throw new \RuntimeException(
'Not valid HTML fragment!' . "\n" .
$tmpDomString . "\n" .
$tmpStr
);
}
|
New finding: it fails because
|
Thanks for the updates, I'll add an edge case test for this and see if I can resolve it in this package or that this has to be fixed upstream |
|
An HTML with code like this:
... throws:
Removing HTML comments is a possible workaround:
This technique may not be fashionable any more but as far as I know it's still valid HTML.
The text was updated successfully, but these errors were encountered: