<?php
// Your code here!
$dom = new DOMDocument();
$html = '<div id="tmp-wrapper">Test Test
<audio class="player mejs-custom" src="$[*audio-file_example_MP3_700KB.mp3*]" type="audio/mp3" playLimit="0" allowPause="False" allowSeek="False">
</audio></div>';
try {
$dom->loadHTML(
mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'),
LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD
);
}catch (\Exception $ex) {
/*
* DOM parser has problem processing HTML content,
* return input as it is.
*/
echo 'Failed to parse DOM document for accessibility: ' . $ex->getMessage();
return $html;
}
?>
I am getting the error for audio tag. is there any way we can prevent exception for audio?
PHP Warning: DOMDocument::loadHTML(): Tag audio invalid in Entity, line: 2 in /workspace/Main.php on line 10