2010-12-30 7 views
7

html5のdoctypeをhtmlpurifierに使用させることはできますか?あなたは、次のとDOCTYPEやエンコーディングを変更することができますhtml5 doctypeのhtmlpurifier

ドキュメントhere状態:

指示をインストール here状態で
<?php 
    require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php'; 

    $config = HTMLPurifier_Config::createDefault(); 
    $config->set('Core', 'Encoding', 'ISO-8859-1'); // replace with your encoding 
    $config->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); // replace with your doctype 
    $purifier = new HTMLPurifier($config); 

    $clean_html = $purifier->purify($dirty_html); 
?> 

が、その後、サポートのdoctypeがあること:

256 Other supported doctypes include: 
257 
258  * HTML 4.01 Strict 
259  * HTML 4.01 Transitional 
260  * XHTML 1.0 Strict 
261  * XHTML 1.0 Transitional 
262  * XHTML 1.1 

がそれですhtml5 doctypeを許可するために次のことを行うことが可能ですか?

<?php 
     require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php'; 

     $config = HTMLPurifier_Config::createDefault(); 
     $config->set('Core', 'Encoding', 'UTF-8'); // replace with your encoding 
     $config->set('HTML', 'Doctype', 'html5'); // replace with your doctype 
     $purifier = new HTMLPurifier($config); 

     $clean_html = $purifier->purify($dirty_html); 
    ?> 

別の方法がありますか?

答えて

11

いいえ、HTML清浄機は現在、HTML 5

+0

あなたはHTML 5のサポートを追加する予定はありますか? – thirtydot

+5

はい、しかし、「ええと、私がそれをやり遂げるまであなたは無期限に待たなければなりません」という意味で。 –

+1

この投稿を見ました:http://htmlpurifier.org/phorum/read.php?2,6169,6169(2012年2月1日付)、HTML5はまだサポートされていません。今は2012年11月です。もしhtml5のサポートが最近追加されたら、私は望んでいましたか? – stormwild

1

をサポートしていない私はそれがまだのHTML5をサポートしていないと思います。おそらくそれが必要な場合は、それらに提案するか、パッチを作成してください。

5

これは本当ですか? This pageは、それはまだHTML5のDOCTYPEをサポートしていませんが、あなたは上記のガイドを使用して追加したいタグものを指定することができ

関連する問題