Avoid percent-encoding href attributes when using PHP's DOMDocument
问题 The best answers I was able to find for this issue are using XSLT, but I'm just not sure how to apply those answers to my problem. Basically, DOMDocument is doing a fine job of escaping URLs (in href attributes) that are passed in, but I'm actually using it to build a Twig/Django style template, and I'd rather it leave them alone. Here's a specific example, illustrating the "problem": <?php $doc = new DOMDocument(); $doc->loadHTML('<html><body>Test<br><a href="{{variable}}"></a></body></html>