From a316ac49a6934221b24ec58a6a7dc4c3b30ae1e8 Mon Sep 17 00:00:00 2001 From: Artem Yunusov Date: Mon, 14 Jul 2008 16:17:33 +0500 Subject: A lot of bug fixes. Handlig attributes added, new hr processing. Reformatted test suite for ElementTree output. --- tests/safe_mode/inline-html-advanced.html | 13 ++--- tests/safe_mode/inline-html-comments.html | 20 +++---- tests/safe_mode/inline-html-simple.html | 97 ++++++++++++++----------------- tests/safe_mode/script_tags.html | 34 +++++------ tests/safe_mode/unsafe_urls.html | 45 +++++++------- 5 files changed, 93 insertions(+), 116 deletions(-) (limited to 'tests/safe_mode') diff --git a/tests/safe_mode/inline-html-advanced.html b/tests/safe_mode/inline-html-advanced.html index bc59ab1..e9dd2ec 100644 --- a/tests/safe_mode/inline-html-advanced.html +++ b/tests/safe_mode/inline-html-advanced.html @@ -1,14 +1,11 @@ -

Simple block on one line: -

-<div>foo</div> - -

And nested without indentation: -

-<div> +

Simple block on one line:

+

<div>foo</div>

+

And nested without indentation:

+

<div> <div> <div> foo </div> </div> <div>bar</div> -</div> \ No newline at end of file +</div>

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-comments.html b/tests/safe_mode/inline-html-comments.html index 8deccba..0f1e417 100644 --- a/tests/safe_mode/inline-html-comments.html +++ b/tests/safe_mode/inline-html-comments.html @@ -1,14 +1,8 @@ -

Paragraph one. -

-<!-- This is a simple comment --> - -<!-- +

Paragraph one.

+

<!-- This is a simple comment -->

+

<!-- This is another comment. ---> - -

Paragraph two. -

-<!-- one comment block -- -- with two comments --> - -

The end. -

\ No newline at end of file +-->

+

Paragraph two.

+

<!-- one comment block -- -- with two comments -->

+

The end.

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html index 24d16ba..ceaaa90 100644 --- a/tests/safe_mode/inline-html-simple.html +++ b/tests/safe_mode/inline-html-simple.html @@ -1,64 +1,53 @@ -

Here's a simple block: -

-<div> +

Here's a simple block:

+

<div> foo -</div> - -

This should be a code block, though: -

-
<div>
+</div>

+

This should be a code block, though:

+
+<div>
     foo
 </div>
-

As should this: -

-
<div>foo</div>
-

Now, nested: -

-<div> +
+
+

As should this:

+
+<div>foo</div>
+
+
+

Now, nested:

+

<div> <div> <div> foo </div> </div> -</div> - -

This should just be an HTML comment: -

-<!-- Comment --> - -

Multiline: -

-<!-- +</div>

+

This should just be an HTML comment:

+

<!-- Comment -->

+

Multiline:

+

<!-- Blah Blah ---> - -

Code block: -

-
<!-- Comment -->
-

Just plain comment, with trailing spaces on the line: -

-<!-- foo --> - -

Code: -

-
<hr />
-

Hr's: -

-<hr> - -<hr/> - -<hr /> - -<hr> - -<hr/> - -<hr /> - -<hr class="foo" id="bar" /> - -<hr class="foo" id="bar"/> - -<hr class="foo" id="bar" > \ No newline at end of file +-->

+

Code block:

+
+<!-- Comment -->
+
+
+

Just plain comment, with trailing spaces on the line:

+

<!-- foo -->

+

Code:

+
+<hr />
+
+
+

Hr's:

+

<hr>

+

<hr/>

+

<hr />

+

<hr>

+

<hr/>

+

<hr />

+

<hr class="foo" id="bar" />

+

<hr class="foo" id="bar"/>

+

<hr class="foo" id="bar" >

\ No newline at end of file diff --git a/tests/safe_mode/script_tags.html b/tests/safe_mode/script_tags.html index cb2abfa..4c669dd 100644 --- a/tests/safe_mode/script_tags.html +++ b/tests/safe_mode/script_tags.html @@ -1,26 +1,20 @@ -

This should be stripped/escaped in safe_mode. -

-<script> +

This should be stripped/escaped in safe_mode.

+

<script> alert("Hello world!") -</script> - -

With blank lines. -

-<script> +</script>

+

With blank lines.

+

<script> alert("Hello world!") -</script> - -

Now with some weirdness -

-

<script <!-- +</script>

+

Now with some weirdness

+

+<script <!-- alert("Hello world!") -</script <>` -

-

Try another way. -

-<script <!-- +</script <>
`

+

Try another way.

+

<script <!-- alert("Hello world!") </script <> @@ -30,4 +24,6 @@ This time with blank lines. alert("Hello world!") -</script <> \ No newline at end of file +</script <> + +

\ No newline at end of file diff --git a/tests/safe_mode/unsafe_urls.html b/tests/safe_mode/unsafe_urls.html index fe37840..6dabe64 100644 --- a/tests/safe_mode/unsafe_urls.html +++ b/tests/safe_mode/unsafe_urls.html @@ -1,25 +1,26 @@ -

These links should be unsafe and not allowed in safe_mode +

These links should be unsafe and not allowed in safe_mode

+

+link +link +link +link +link +link +link +link +link +link +link

-

link - link - link - link - link - link - link - link - link - link - link +

+img +ref +imgref

-

img - ref - imgref -

-

These should work regardless: -

-

relative - email - news scheme - http link +

These should work regardless:

+

+relative +email +news scheme +http link

-- cgit v1.2.3