0

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');
4

1 回答 1

1

我不知道任何定义allowfullscreen属性的 XHTML 规范,这可以解释为什么 tidy 不将其识别为布尔属性。

如果它是一个布尔属性,那么true它就不是一个有效的值。名称和值将是相同的字符串。

于 2013-01-19T23:59:25.580 回答