function myTidy($content) {
$tidyConfig = array(
'indent' => false, //don't indent
'doctype' => 'omit', //don't include doctype
'wrap' => 0, // don't line wrap
'show-body-only' => true, //don't include <html><head><title><body>
'drop-proprietary-attributes' => false, //this doesn't seem to be helping with our youtube stuff...
);
$tidy = tidy_parse_string($content, $tidyConfig, 'UTF8');
$tidy->cleanRepair();
return (string)$tidy;
}
echo myTidy('<span _my_custom_attr="asdfsdf">asdf</span>'), "\n";
sortie souhaitéeComment puis-je obtenir bien rangé pour autoriser mes attributs personnalisés?
<span _my_custom_attr="asdfsdf">asdf</span>
sortie actuelle:
<span>asdf</span>
Que faut-il pour obtenir bien rangé pour permettre attribut mon habitude?
Oui. C'était ça. –
Même dans la syntaxe SO, le trait de soulignement n'est pas éclairé correctement :) – 2ndkauboy
Oui. C'est ce qui m'a poussé à essayer de l'enlever moi-même. –