mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-04 05:07:55 +02:00
[3.1.2] Implement comments when %HTML.Trusted is on.
Some implementation notes: not all comments are valid; HTML makes sure double-hyphens and trailing hyphens are not found in comments. In addition, two new localizable messages were added. Requested-by: Waldo Jaquith <waldo@vqronline.org> Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -88,5 +88,20 @@ alert(<b>bold</b>);
|
||||
$this->assertResult('<f req="text">Foo</f> Bar');
|
||||
}
|
||||
|
||||
function testPreserveCommentsWithHTMLTrusted() {
|
||||
$this->config->set('HTML', 'Trusted', true);
|
||||
$this->assertResult('<!-- foo -->');
|
||||
}
|
||||
|
||||
function testRemoveTrailingHyphensInComment() {
|
||||
$this->config->set('HTML', 'Trusted', true);
|
||||
$this->assertResult('<!-- foo ----->', '<!-- foo -->');
|
||||
}
|
||||
|
||||
function testCollapseDoubleHyphensInComment() {
|
||||
$this->config->set('HTML', 'Trusted', true);
|
||||
$this->assertResult('<!-- bo --- asdf--as -->', '<!-- bo - asdf-as -->');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user