JS - location.hash - no escape single quote

This commit is contained in:
janekptacijarabaci 2018-02-12 19:40:38 +01:00 committed by Roy Tam
commit 637540d66e
2 changed files with 12 additions and 1 deletions

View file

@ -251,6 +251,17 @@ add_test(function test_escapeBrackets()
run_next_test();
});
add_test(function test_escapeQuote()
{
var url = stringToURL("http://example.com/#'");
do_check_eq(url.spec, "http://example.com/#'");
do_check_eq(url.ref, "'");
url.ref = "test'test";
do_check_eq(url.spec, "http://example.com/#test'test");
do_check_eq(url.ref, "test'test");
run_next_test();
});
add_test(function test_apostropheEncoding()
{
// For now, single quote is escaped everywhere _except_ the path.