From a2377e1129331430998de821ed3abf38247edca1 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Sat, 14 Jan 2012 13:10:44 -0500 Subject: When safe mode is 'escape', don't allow bad html to stop further processing. See tests/html4_safe/html_then_blockquote.(txt|html). It looks like having unclosed block-level html elements was causing further processing not to happen, even in the case where we're escaping HTML. Since we're escaping HTML, it seems like it shouldn't affect processing at all. This changes output results in a couple of other tests, but the new output seems reasonable to me. --- tests/html4_safe/html_then_blockquote.html | 6 ++++++ tests/html4_safe/html_then_blockquote.txt | 6 ++++++ tests/safe_mode/inline-html-simple.html | 11 +++++++---- tests/safe_mode/script_tags.html | 26 +++++++++----------------- 4 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 tests/html4_safe/html_then_blockquote.html create mode 100644 tests/html4_safe/html_then_blockquote.txt (limited to 'tests') diff --git a/tests/html4_safe/html_then_blockquote.html b/tests/html4_safe/html_then_blockquote.html new file mode 100644 index 0000000..5833cd4 --- /dev/null +++ b/tests/html4_safe/html_then_blockquote.html @@ -0,0 +1,6 @@ +

to:

+

<td /><td style="text-align: center; white-space: nowrap;"><br />

+
+

3) You don't need to alter all localization files. + Adding the new labels to the en_US files will do it.

+
\ No newline at end of file diff --git a/tests/html4_safe/html_then_blockquote.txt b/tests/html4_safe/html_then_blockquote.txt new file mode 100644 index 0000000..544df67 --- /dev/null +++ b/tests/html4_safe/html_then_blockquote.txt @@ -0,0 +1,6 @@ +to: + +
+ +> 3) You don't need to alter all localization files. +> Adding the new labels to the en_US files will do it. diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html index ad19a77..aca9af0 100644 --- a/tests/safe_mode/inline-html-simple.html +++ b/tests/safe_mode/inline-html-simple.html @@ -29,7 +29,8 @@ Blah
<!-- Comment -->
 

Just plain comment, with trailing spaces on the line:

-

<!-- foo -->

+

<!-- foo -->
+

Code:

<hr />
 
@@ -37,9 +38,11 @@ Blah

<hr>

<hr/>

<hr />

-

<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 df63ffc..f3b059d 100644 --- a/tests/safe_mode/script_tags.html +++ b/tests/safe_mode/script_tags.html @@ -1,13 +1,11 @@

This should be stripped/escaped in safe_mode.

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

With blank lines.

-

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

+

<script>

+

alert("Hello world!")

+

</script>

Now with some weirdness

<script <!-- alert("Hello world!") @@ -15,14 +13,8 @@ alert("Hello world!")

Try another way.

<script <!-- alert("Hello world!") -</script <> - -This time with blank lines. - -<script <!-- - -alert("Hello world!") - -</script <> - -

\ No newline at end of file +</script <>

+

This time with blank lines.

+

<script <!--

+

alert("Hello world!")

+

</script <>

\ No newline at end of file -- cgit v1.2.3