Fix for DOMDocument behavior for newer PHP versions.
Merge pull request #22 from rexington/1078819-source-html-issues

Fix for DOMDocument behavior for newer PHP versions.