Update DOM process to use a library that better supports HTML5 #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Installed extension on CiviCRM 5.30 w/ php7.3.
This extension was breaking with a number of html5 features such as
<script type="text/template">
that are used in the core now. This was most noticeable on the event page. TheDOMDocument
processor was adding</script>
tags anywhere a closing tab (eg</div>
) was found inside and<script>
tag.The HTML5DOMDocument library found here https://github.com/ivopetkov/html5-dom-document-php seemed to work the best and be the most active for support and updates. This Pull Request replaces the built in
DOMDocument
class withIvoPetkov\HTML5DOMDocument
. SinceIvoPetkov\HTML5DOMDocument
extendsDOMDocument
only providing a thin wrapper, the replacement was very straight forward.The library was installed with composer. I am not certain if this is the best path for a CiviCRM extension although it works well in my testing.
One file was modified/hacked in a small from the current release of
HTML5DOMDocument
to fix an issue with the way the library processes some elements. This pull request (ivopetkov/html5-dom-document-php#38) is merge into the upstream library but not available in the current release.