paquettg / php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.
MIT License
2.36k stars 457 forks source link

Twig template loading #210

Open hoxhaj opened 4 years ago

hoxhaj commented 4 years ago

I am loading a twig template and modifying the html. I can modify the html but it breaks the twig string.

After i load the .twig file whith loadFromFile() this div:

<div {{ not variable_name ? 'class="class_name"' }} id="id_name">

turns to:

<div {{ not variable_name ? 'class="class_name" }} id="id_name">

'class="class_name"<=== the single quote after the double quotes is lost.

I wanted to know if there is an option to set for this purpose or this case is not handled.

Thanks!

paquettg commented 4 years ago

This case is not handled, we will look to add support for this case but twig was not something that was taken into account.