html5-php icon indicating copy to clipboard operation
html5-php copied to clipboard

How to disable DOCType, HTML, HEAD & BODY tag

Open th3-sh0w3r opened this issue 5 years ago • 1 comments

Hey,

how do I disable the (DOCType, HTML, HEAD & BODY tags)? I just want that my Input is the same as my output.

Now:

Input: <div><p>Test</p></div>
Output: <DOCTYPE><html><head></head><body><div><p>Test</p></div></body></html>

What I want:

Input: <div><p>Test</p></div>
Output: <div><p>Test</p></div>

th3-sh0w3r avatar Sep 05 '20 13:09 th3-sh0w3r

Seems to work fine for me:

$html5 = new HTML5();
$dom = $html5->loadHTMLFragment('<div><p>Test</p></div>');
$html5->saveHTML($dom); // renders: <div><p>Test</p></div>

drtheuns avatar Oct 08 '20 17:10 drtheuns

@goetas this issue should be closed as the answer has been provided.

stof avatar Jan 12 '23 14:01 stof