Frage

I am working with DOMDocument / DOMXPath to try and make CSS inline. It would work perfectly except that the HTML I am passing to it trips it up saying it's not valid XML.

How can I set these functions to ignore unknown tags?

Anyway I can make these functions less finicky? I use the phpQuery classes to manipulate and output everything. But when I pass it to the inlinify stuff it breaks.

Other web-based inlinify apps have no problem with the output html I have.

And also.. anyone know a non-DOMDocument / DOMXPath way to do this? All CSS is between a single style pair of tags. Maybe fancy regex or phpQuery itself or both?

Thanks a ton!

War es hilfreich?

Lösung

To be fair, it's not wrong. If you want to load HTML then you should be using DOMDocument::loadHTML*().

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top