Question

I'm parsing simple oembed urls from youtube, and converting them to xhtml, however, some html gets tidy'd (I believe to be) incorrectly. Shouldn't the valid xhtml be allowFullScreen="true"????? If this is correct, is there some tidy module that will do that? I must I go the "purifier" route?

input from youtube:

<iframe allowfullscreen ... ></iframe>

final output after tidy'ing:

<iframe allowfullscreen="" ...></iframe>

PHP Tidy:

$tidy                   =  new \tidy();
$config             =  array(
    'show-body-only'   => true,
    'char-encoding'    => 'utf8'
);
$output = $tidy -> repairString($data['html'], $config, 'UTF8');
Was it helpful?

Solution

I'm not aware of any XHTML specification that defines an allowfullscreen attribute, which would explain why tidy isn't recognising it as a boolean attribute.

If it is a boolean attribute, then true would not be a valid value for it. The name and the value would be the same string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top