1
0
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:
Edward Z. Yang
2008-06-24 22:36:27 -04:00
parent 85fb192d93
commit 24f6db6fb2
6 changed files with 41 additions and 6 deletions

View File

@@ -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">'
);
}
}