mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
[3.1.2] Add %Output.SortAttr to deal with FCKeditor bug
If %Output.SortAttr is true, attributes are sorted to be in alphabetical order. This was requested by frank farmer. See also: http://htmlpurifier.org/phorum/read.php?2,1576 Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -209,7 +209,6 @@ class HTMLPurifier_GeneratorTest extends HTMLPurifier_Harness
|
||||
}
|
||||
|
||||
function test_generateFromTokens_XHTMLoff() {
|
||||
$this->config = HTMLPurifier_Config::createDefault();
|
||||
$this->config->set('HTML', 'XHTML', false);
|
||||
|
||||
// omit trailing slash
|
||||
@@ -237,7 +236,6 @@ class HTMLPurifier_GeneratorTest extends HTMLPurifier_Harness
|
||||
// just don't test; Tidy is exploding on me.
|
||||
return;
|
||||
|
||||
$this->config = HTMLPurifier_Config::createDefault();
|
||||
$this->config->set('Core', 'TidyFormat', true);
|
||||
$this->config->set('Output', 'Newline', "\n");
|
||||
|
||||
@@ -253,5 +251,15 @@ class HTMLPurifier_GeneratorTest extends HTMLPurifier_Harness
|
||||
|
||||
}
|
||||
|
||||
function test_generateFromTokens_sortAttr() {
|
||||
$this->config->set('Output', 'SortAttr', true);
|
||||
|
||||
$this->assertGeneration(
|
||||
array( new HTMLPurifier_Token_Start('p', array('b'=>'c', 'a'=>'d')) ),
|
||||
'<p a="d" b="c">'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user