1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 21:57:26 +02:00

Remove trailing whitespace.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2008-12-06 02:28:20 -05:00
parent 3a6b63dff1
commit 2c955af135
476 changed files with 5595 additions and 5547 deletions

View File

@@ -2,27 +2,27 @@
class HTMLPurifier_AttrDef_LangTest extends HTMLPurifier_AttrDefHarness
{
function test() {
$this->def = new HTMLPurifier_AttrDef_Lang();
// basic good uses
$this->assertDef('en');
$this->assertDef('en-us');
$this->assertDef(' en ', 'en'); // trim
$this->assertDef('EN', 'en'); // case insensitivity
// (thanks Eugen Pankratz for noticing the typos!)
$this->assertDef('En-Us-Edison', 'en-us-edison'); // complex ci
$this->assertDef('fr en', false); // multiple languages
$this->assertDef('%', false); // bad character
// test overlong language according to syntax
$this->assertDef('thisistoolongsoitgetscut', false);
// primary subtag rules
// I'm somewhat hesitant to allow x and i as primary language codes,
// because they usually are never used in real life. However,
@@ -44,7 +44,7 @@ class HTMLPurifier_AttrDef_LangTest extends HTMLPurifier_AttrDefHarness
$this->assertDef('four', false);
// for similar reasons, disallow any other one character language
$this->assertDef('f', false);
// second subtag rules
// one letter subtags prohibited until revision. This is, however,
// less volatile than the restrictions on the primary subtags.
@@ -57,28 +57,28 @@ class HTMLPurifier_AttrDef_LangTest extends HTMLPurifier_AttrDefHarness
// be checked without maintaining country code lookup tables (for
// two characters) or special registration tables (for all above).
$this->assertDef('en-uk', true);
// further subtag rules: only syntactic constraints
$this->assertDef('en-us-edison');
$this->assertDef('en-us-toolonghaha', 'en-us');
$this->assertDef('en-us-a-silly-long-one');
// rfc 3066 stipulates that if a three letter and a two letter code
// are available, the two letter one MUST be used. Without a language
// code lookup table, we cannot implement this functionality.
// although the HTML protocol, technically speaking, allows you to
// omit language tags, this implicitly means that the parent element's
// language is the one applicable, which, in some cases, is incorrect.
// Thus, we allow und, only slightly defying the RFC's SHOULD NOT
// designation.
$this->assertDef('und');
// because attributes only allow one language, mul is allowed, complying
// with the RFC's SHOULD NOT designation.
$this->assertDef('mul');
}
}