質問

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!

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top