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

Post content is wrapped in duplicate <html><body> #2

Open
robertandrews opened this issue May 18, 2022 · 1 comment
Open

Post content is wrapped in duplicate <html><body> #2

robertandrews opened this issue May 18, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@robertandrews
Copy link
Owner

robertandrews commented May 18, 2022

This is causing a problem. Post body content is being wrapped in <html><body></body></html>...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>Since they launched in November 2020, the latest generation of games consoles have already racked up millions of shipments.</p>
<p>But sales is not the only <a href="https://themap.local/topic/gaming/">gaming</a> revenue stream.</p>
<p>

When this plugin is disabled, the problem goes away.

It needs to be fixed.

@robertandrews
Copy link
Owner Author

Check https://stackoverflow.com/questions/8218230/php-domdocument-loadhtml-not-encoding-utf-8-correctly for eg. ...

$dom->loadHTML($string, LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED);

... instead of ...

$dom->loadhtml(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));

This removes the duplicate wrapping around the_content. But I need to a) understand what it means and b) ensure character formatting does not go wonky again.

In my case, with the above change, in-line photos also begin lacking bottom spacing above paragraphs - but only because I remove image's

tags using plugin Image P tag remover.

@robertandrews robertandrews self-assigned this May 19, 2022
@robertandrews robertandrews added the bug Something isn't working label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant