diff --git a/composer.json b/composer.json index 072e71b..3d82555 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "kenshodigital/kirby-xhtml", "description": "Ensures well-formed XHTML output for Kirby templates.", "type": "kirby-plugin", - "version": "2.0.0", + "version": "2.0.1", "homepage": "https://github.com/kenshodigital/kirby-xhtml", "license": "MIT", "authors": diff --git a/index.php b/index.php index 6a614a2..ddee02a 100755 --- a/index.php +++ b/index.php @@ -6,6 +6,7 @@ namespace Kenshō\XHTML; +use DOMDocument; use DOMImplementation; use Kirby\Cms\App; @@ -28,11 +29,13 @@ $document = $dom->createDocument(null, '', $doctype); $document->xmlVersion = '1.0'; $document->encoding = 'utf-8'; - $document->preserveWhiteSpace = false; $fragment = $document->createDocumentFragment(); - $fragment->appendXML($html); $document->appendChild($fragment); + $xml = $document->saveXML(); + $document = new DOMDocument('1.0', 'utf-8'); + $document->preserveWhiteSpace = false; + $document->loadXML($xml); App::instance()->response()->type('application/xhtml+xml');