bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Stray doctype html validation error when using gistpress #63

Closed jdelia closed 7 years ago

jdelia commented 8 years ago

When using gistpress - it is inserting a stray doctype html and body tags generating errors in the validator. Issue seen on multiple websites including your own site http://www.cedaro.com/

See this line in your code: https://github.com/bradyvercher/gistpress/blob/develop/includes/class-gistpress.php#L472

screen shot 2016-03-19 at 1 47 17 pm

https://validator.w3.org/nu/?doc=https%3A%2F%2Fjackiedelia.com%2Fadding-svg-logo-utility-pro-theme%2F

GaryJones commented 8 years ago

@bradyvercher I think after the HTML is dumped out of the DOMDocument object, we'll need to strip the doctype, html and body elements that preceed / wrap around the div we're really interested in.

Nilpo commented 8 years ago

I believe I have a solution for this. Let me pull the latest code and test it.

GaryJones commented 7 years ago

Closed in #64.

@jdelia - Does this fix it for you?