Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Parsing HTML5 data .. #20

Open
marmz opened this issue Nov 30, 2016 · 0 comments
Open

Parsing HTML5 data .. #20

marmz opened this issue Nov 30, 2016 · 0 comments

Comments

@marmz
Copy link

marmz commented Nov 30, 2016

Hi! I first downloaded original phpQuery code from Google Code site, and i love the project ;)

I had problems using PQ with some html5 markup ..
In particular, when i try to work with Special SCRIPTS (i.e: HandleBars templates) inside script tag, phpQuery breaks the code, because it treats text inside as it was normal html.

For example, consider "appending" this simple code:

$doc->append("<script> document.write('<div>Hello!</div>'); </script>");

PQ transforms it like this:

<script> document.write('<div>Hello!'); </script>

I had to use Masterminds php-HTML5 Parser like this:

$HTML5 = new HTML5(['disable_html_ns'=>true]) ;
$doc->append($HTML5->loadHTMLFragment("<script> document.write('<div>Hello!</div>'); </script>"));

So, i'd like to know if it is possible to extend phpQuery html parser to use a (better) HTML5 parser, just like Masterminds, or any other ...
I could try to do the trick by myself, but i need someone to address me to where i must add the code.

Hope this could be useful for someone else. TY!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant