aboutsummaryrefslogtreecommitdiffstats
path: root/tests/safe_mode
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-03-19 03:47:16 +0000
committerWaylan Limberg <waylan@gmail.com>2008-03-19 03:47:16 +0000
commita190c3941a7bed4274fe08e92ba4ce368c1c837f (patch)
treee936f95bde7b0b06d0422f16afd125bb290cb130 /tests/safe_mode
parent2db5d1c8e469d2943a6a851bc0ff3ede070e448b (diff)
downloadmarkdown-a190c3941a7bed4274fe08e92ba4ce368c1c837f.tar.gz
markdown-a190c3941a7bed4274fe08e92ba4ce368c1c837f.tar.bz2
markdown-a190c3941a7bed4274fe08e92ba4ce368c1c837f.zip
Added safe_mode to testing framework and soem tests.
Diffstat (limited to 'tests/safe_mode')
-rw-r--r--tests/safe_mode/inline-html-advanced.html14
-rw-r--r--tests/safe_mode/inline-html-advanced.txt14
-rw-r--r--tests/safe_mode/inline-html-comments.html14
-rw-r--r--tests/safe_mode/inline-html-comments.txt13
-rw-r--r--tests/safe_mode/inline-html-simple.html64
-rw-r--r--tests/safe_mode/inline-html-simple.txt69
-rw-r--r--tests/safe_mode/script_tags.html33
-rw-r--r--tests/safe_mode/script_tags.txt33
8 files changed, 254 insertions, 0 deletions
diff --git a/tests/safe_mode/inline-html-advanced.html b/tests/safe_mode/inline-html-advanced.html
new file mode 100644
index 0000000..bc59ab1
--- /dev/null
+++ b/tests/safe_mode/inline-html-advanced.html
@@ -0,0 +1,14 @@
+<p>Simple block on one line:
+</p>
+&lt;div&gt;foo&lt;/div&gt;
+
+<p>And nested without indentation:
+</p>
+&lt;div&gt;
+&lt;div&gt;
+&lt;div&gt;
+foo
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div&gt;bar&lt;/div&gt;
+&lt;/div&gt; \ No newline at end of file
diff --git a/tests/safe_mode/inline-html-advanced.txt b/tests/safe_mode/inline-html-advanced.txt
new file mode 100644
index 0000000..9d71ddc
--- /dev/null
+++ b/tests/safe_mode/inline-html-advanced.txt
@@ -0,0 +1,14 @@
+Simple block on one line:
+
+<div>foo</div>
+
+And nested without indentation:
+
+<div>
+<div>
+<div>
+foo
+</div>
+</div>
+<div>bar</div>
+</div>
diff --git a/tests/safe_mode/inline-html-comments.html b/tests/safe_mode/inline-html-comments.html
new file mode 100644
index 0000000..8deccba
--- /dev/null
+++ b/tests/safe_mode/inline-html-comments.html
@@ -0,0 +1,14 @@
+<p>Paragraph one.
+</p>
+&lt;!-- This is a simple comment --&gt;
+
+&lt;!--
+ This is another comment.
+--&gt;
+
+<p>Paragraph two.
+</p>
+&lt;!-- one comment block -- -- with two comments --&gt;
+
+<p>The end.
+</p> \ No newline at end of file
diff --git a/tests/safe_mode/inline-html-comments.txt b/tests/safe_mode/inline-html-comments.txt
new file mode 100644
index 0000000..41d830d
--- /dev/null
+++ b/tests/safe_mode/inline-html-comments.txt
@@ -0,0 +1,13 @@
+Paragraph one.
+
+<!-- This is a simple comment -->
+
+<!--
+ This is another comment.
+-->
+
+Paragraph two.
+
+<!-- one comment block -- -- with two comments -->
+
+The end.
diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html
new file mode 100644
index 0000000..24d16ba
--- /dev/null
+++ b/tests/safe_mode/inline-html-simple.html
@@ -0,0 +1,64 @@
+<p>Here's a simple block:
+</p>
+&lt;div&gt;
+ foo
+&lt;/div&gt;
+
+<p>This should be a code block, though:
+</p>
+<pre><code>&lt;div&gt;
+ foo
+&lt;/div&gt;
+</code></pre><p>As should this:
+</p>
+<pre><code>&lt;div&gt;foo&lt;/div&gt;
+</code></pre><p>Now, nested:
+</p>
+&lt;div&gt;
+ &lt;div&gt;
+ &lt;div&gt;
+ foo
+ &lt;/div&gt;
+ &lt;/div&gt;
+&lt;/div&gt;
+
+<p>This should just be an HTML comment:
+</p>
+&lt;!-- Comment --&gt;
+
+<p>Multiline:
+</p>
+&lt;!--
+Blah
+Blah
+--&gt;
+
+<p>Code block:
+</p>
+<pre><code>&lt;!-- Comment --&gt;
+</code></pre><p>Just plain comment, with trailing spaces on the line:
+</p>
+&lt;!-- foo --&gt;
+
+<p>Code:
+</p>
+<pre><code>&lt;hr /&gt;
+</code></pre><p>Hr's:
+</p>
+&lt;hr&gt;
+
+&lt;hr/&gt;
+
+&lt;hr /&gt;
+
+&lt;hr&gt;
+
+&lt;hr/&gt;
+
+&lt;hr /&gt;
+
+&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;
+
+&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;/&gt;
+
+&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; &gt; \ No newline at end of file
diff --git a/tests/safe_mode/inline-html-simple.txt b/tests/safe_mode/inline-html-simple.txt
new file mode 100644
index 0000000..14aa2dc
--- /dev/null
+++ b/tests/safe_mode/inline-html-simple.txt
@@ -0,0 +1,69 @@
+Here's a simple block:
+
+<div>
+ foo
+</div>
+
+This should be a code block, though:
+
+ <div>
+ foo
+ </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:
+
+<!--
+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" >
+
diff --git a/tests/safe_mode/script_tags.html b/tests/safe_mode/script_tags.html
new file mode 100644
index 0000000..cb2abfa
--- /dev/null
+++ b/tests/safe_mode/script_tags.html
@@ -0,0 +1,33 @@
+<p>This should be stripped/escaped in safe_mode.
+</p>
+&lt;script&gt;
+alert(&quot;Hello world!&quot;)
+&lt;/script&gt;
+
+<p>With blank lines.
+</p>
+&lt;script&gt;
+
+alert(&quot;Hello world!&quot;)
+
+&lt;/script&gt;
+
+<p>Now with some weirdness
+</p>
+<p><code>&lt;script &lt;!--
+alert("Hello world!")
+&lt;/script &lt;&gt;</code>`
+</p>
+<p>Try another way.
+</p>
+&lt;script &lt;!--
+alert(&quot;Hello world!&quot;)
+&lt;/script &lt;&gt;
+
+This time with blank lines.
+
+&lt;script &lt;!--
+
+alert(&quot;Hello world!&quot;)
+
+&lt;/script &lt;&gt; \ No newline at end of file
diff --git a/tests/safe_mode/script_tags.txt b/tests/safe_mode/script_tags.txt
new file mode 100644
index 0000000..55c60e9
--- /dev/null
+++ b/tests/safe_mode/script_tags.txt
@@ -0,0 +1,33 @@
+This should be stripped/escaped in safe_mode.
+
+<script>
+alert("Hello world!")
+</script>
+
+With blank lines.
+
+<script>
+
+alert("Hello world!")
+
+</script>
+
+Now with some weirdness
+
+``<script <!--
+alert("Hello world!")
+</script <>```
+
+Try another way.
+
+<script <!--
+alert("Hello world!")
+</script <>
+
+This time with blank lines.
+
+<script <!--
+
+alert("Hello world!")
+
+</script <>