Skip to content
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

Adds doctypes when not needed/requested #200

Open
awderh opened this issue Oct 5, 2020 · 1 comment · May be fixed by #213
Open

Adds doctypes when not needed/requested #200

awderh opened this issue Oct 5, 2020 · 1 comment · May be fixed by #213

Comments

@awderh
Copy link

awderh commented Oct 5, 2020

$cssToInlineStyles = new \TijsVerkoyen\CssToInlineStyles\CssToInlineStyles();
$css = '.hi { font-style: bold; }';
$html = '<table class="hi"></table>';
echo $cssToInlineStyles->convert($html, $css);

Actual:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><table class="hi" style="font-style: bold;"></table></body></html>

Expected:

<table style="font-style: bold;"></table>
@awderh
Copy link
Author

awderh commented Oct 5, 2020

Potential fix, could add:

LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD

to LoadHTML in

createDomDocumentFromHtml

for users who don't want it.

I'll extend the class in the meantime.

@bytestream bytestream linked a pull request May 21, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant