-
Notifications
You must be signed in to change notification settings - Fork 112
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
Prevent wrapping in <!DOCTYPE html> <html> #226
Comments
It's a workaround but here's how I'm achieving this: str_replace(
['<!DOCTYPE html>', '<html>', '<body>', '</body>', '</html>'],
'',
$html->saveHTML($dom)
) |
that is not cool |
In my code I can prevent the wrapper markup when I render only the fragment that was parsed: $events = new DOMTreeBuilder(true, $options);
$scanner = new Scanner('<p>Hello World!</p>');
$parser = new Tokenizer($scanner, $events);
$parser->parse();
$html5 = new HTML5();
echo $html5->saveHTML($events->fragment()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any way to prevent the saveHTML method from wrapping the output in ?
inb4 loadHTMLFragment, can't use it since it won't allow to use the getElementsByTagName method.
The text was updated successfully, but these errors were encountered: