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

Parsing HTML5 data .. #20

@marmz

Description

@marmz

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions