mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 19:30:21 +02:00
Implement %HTML.AllowedComments and %HTML.AllowedCommentsRegexp
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -100,6 +100,16 @@ alert(<b>bold</b>);
|
||||
$this->assertResult('<!-- bo --- asdf--as -->', '<!-- bo - asdf-as -->');
|
||||
}
|
||||
|
||||
function testPreserveCommentsWithLookup() {
|
||||
$this->config->set('HTML.AllowedComments', array('allowed'));
|
||||
$this->assertResult('<!-- allowed --><!-- not allowed -->', '<!-- allowed -->');
|
||||
}
|
||||
|
||||
function testPreserveCommentsWithRegexp() {
|
||||
$this->config->set('HTML.AllowedCommentsRegexp', '/^allowed[1-9]$/');
|
||||
$this->assertResult('<!-- allowed1 --><!-- not allowed -->', '<!-- allowed1 -->');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
|
Reference in New Issue
Block a user