aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-04 22:52:16 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-04 22:52:16 +0000
commit030d94e1c3cd4be0ab9d7c16fccfa973cedb5d38 (patch)
tree325452ca83818bc0776e257f44342776f9bff78d /tests
parent24f3710e0911fa8ebe6070ef83c6206e54a46f1a (diff)
downloadpandoc-030d94e1c3cd4be0ab9d7c16fccfa973cedb5d38.tar.gz
Refactored SGML escaping functions and "in tag" functions to
Text/Shared/Pandoc. (escapeSGML, stringToSGML, inTag, inTagSimple, inTagIndented, selfClosingTag) These can be used by both the HTML and Docbook writers. git-svn-id: https://pandoc.googlecode.com/svn/trunk@417 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'tests')
-rw-r--r--tests/s5.basic.html2
-rw-r--r--tests/s5.fragment.html2
-rw-r--r--tests/s5.inserts.html2
-rw-r--r--tests/writer.docbook29
-rw-r--r--tests/writer.html48
-rw-r--r--tests/writer.smart.html44
6 files changed, 64 insertions, 63 deletions
diff --git a/tests/s5.basic.html b/tests/s5.basic.html
index ac06eabd0..50ce30968 100644
--- a/tests/s5.basic.html
+++ b/tests/s5.basic.html
@@ -768,7 +768,7 @@ window.onresize = function(){setTimeout('fontScale()', 50);}</script>
<div class="slide">
<h1>Smarty</h1>
<ul class="incremental">
-<li>"Hello there"</li>
+<li>&quot;Hello there&quot;</li>
<li>Here's a -- dash</li>
<li>And 'ellipses'...</li>
</ul>
diff --git a/tests/s5.fragment.html b/tests/s5.fragment.html
index 370b9c111..c40f2514e 100644
--- a/tests/s5.fragment.html
+++ b/tests/s5.fragment.html
@@ -6,7 +6,7 @@
<h1>Smarty</h1>
<blockquote>
<ul>
-<li>"Hello there"</li>
+<li>&quot;Hello there&quot;</li>
<li>Here's a -- dash</li>
<li>And 'ellipses'...</li>
</ul>
diff --git a/tests/s5.inserts.html b/tests/s5.inserts.html
index 7be33a2c8..c7e544409 100644
--- a/tests/s5.inserts.html
+++ b/tests/s5.inserts.html
@@ -21,7 +21,7 @@ STUFF INSERTED
<h1>Smarty</h1>
<blockquote>
<ul>
-<li>"Hello there"</li>
+<li>&quot;Hello there&quot;</li>
<li>Here's a -- dash</li>
<li>And 'ellipses'...</li>
</ul>
diff --git a/tests/writer.docbook b/tests/writer.docbook
index 3cf7b6bcf..150b63bac 100644
--- a/tests/writer.docbook
+++ b/tests/writer.docbook
@@ -89,7 +89,7 @@
</para>
<screen>
sub status {
- print "working";
+ print &quot;working&quot;;
}
</screen>
<para>
@@ -133,7 +133,7 @@ sub status {
</para>
<screen>
sub status {
- print "working";
+ print &quot;working&quot;;
}
</screen>
</blockquote>
@@ -177,7 +177,7 @@ sub status {
---- (should be four hyphens)
sub status {
- print "working";
+ print &quot;working&quot;;
}
this code block is indented by one tab
@@ -188,7 +188,7 @@ this code block is indented by one tab
<screen>
this code block is indented by two tabs
-These should not be escaped: \$ \\ \> \[ \{
+These should not be escaped: \$ \\ \&gt; \[ \{
</screen>
</section>
<section>
@@ -577,15 +577,16 @@ These should not be escaped: \$ \\ \> \[ \{
word.
</para>
<para>
- This is code: <literal>></literal>, <literal>$</literal>,
+ This is code: <literal>&gt;</literal>, <literal>$</literal>,
<literal>\</literal>, <literal>\$</literal>,
- <literal>&lt;html></literal>.
+ <literal>&lt;html&gt;</literal>.
</para>
</section>
<section>
<title>Smart quotes, ellipses, dashes</title>
<para>
- "Hello," said the spider. "'Shelob' is my name."
+ &quot;Hello,&quot; said the spider. &quot;'Shelob' is my
+ name.&quot;
</para>
<para>
'A', 'B', and 'C' are letters.
@@ -594,11 +595,11 @@ These should not be escaped: \$ \\ \> \[ \{
'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
</para>
<para>
- 'He said, "I want to go."' Were you alive in the 70's?
+ 'He said, &quot;I want to go.&quot;' Were you alive in the 70's?
</para>
<para>
Here is some quoted '<literal>code</literal>' and a
- "<ulink url="http://example.com/?foo=1&amp;bar=2">quoted link</ulink>".
+ &quot;<ulink url="http://example.com/?foo=1&amp;bar=2">quoted link</ulink>&quot;.
</para>
<para>
Some dashes: one---two --- three--four -- five.
@@ -672,7 +673,7 @@ These should not be escaped: \$ \\ \> \[ \{
<listitem>
<para>
$22,000 is a <emphasis>lot</emphasis> of money. So is $34,000. (It
- worked if "lot" is emphasized.)
+ worked if &quot;lot&quot; is emphasized.)
</para>
</listitem>
<listitem>
@@ -909,17 +910,17 @@ Cat &amp; 1 \\ \hline
</blockquote>
<para>
Auto-links should not occur here:
- <literal>&lt;http://example.com/></literal>
+ <literal>&lt;http://example.com/&gt;</literal>
</para>
<screen>
-or here: &lt;http://example.com/>
+or here: &lt;http://example.com/&gt;
</screen>
</section>
</section>
<section>
<title>Images</title>
<para>
- From "Voyage dans la Lune" by Georges Melies (1902):
+ From &quot;Voyage dans la Lune&quot; by Georges Melies (1902):
</para>
<para>
<inlinemediaobject>
@@ -963,7 +964,7 @@ or here: &lt;http://example.com/>
footnote (as with list items).
</para>
<screen>
- { &lt;code> }
+ { &lt;code&gt; }
</screen>
<para>
If you want, you can indent every line, but you can also be lazy
diff --git a/tests/writer.html b/tests/writer.html
index 191b1982e..8915a172c 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -39,7 +39,7 @@ here.</p>
<blockquote>
<p>Code in a block quote:</p>
<pre><code>sub status {
- print "working";
+ print &quot;working&quot;;
}
</code></pre>
<p>A list:</p>
@@ -60,7 +60,7 @@ here.</p>
<blockquote>
<p>Example:</p>
<pre><code>sub status {
- print "working";
+ print &quot;working&quot;;
}
</code></pre>
</blockquote>
@@ -84,7 +84,7 @@ here.</p>
<pre><code>---- (should be four hyphens)
sub status {
- print "working";
+ print &quot;working&quot;;
}
this code block is indented by one tab
@@ -92,7 +92,7 @@ this code block is indented by one tab
<p>And:</p>
<pre><code> this code block is indented by two tabs
-These should not be escaped: \$ \\ \> \[ \{
+These should not be escaped: \$ \\ \&gt; \[ \{
</code></pre>
<hr />
<h1>Lists</h1>
@@ -255,12 +255,12 @@ These should not be escaped: \$ \\ \> \[ \{
<div>
foo</div>
<p>This should be a code block, though:</p>
-<pre><code>&lt;div>
+<pre><code>&lt;div&gt;
foo
-&lt;/div>
+&lt;/div&gt;
</code></pre>
<p>As should this:</p>
-<pre><code>&lt;div>foo&lt;/div>
+<pre><code>&lt;div&gt;foo&lt;/div&gt;
</code></pre>
<p>Now, nested:</p>
<div>
@@ -281,12 +281,12 @@ Blah
This is another comment.
-->
<p>Code block:</p>
-<pre><code>&lt;!-- Comment -->
+<pre><code>&lt;!-- Comment --&gt;
</code></pre>
<p>Just plain comment, with trailing spaces on the line:</p>
<!-- foo -->
<p>Code:</p>
-<pre><code>&lt;hr />
+<pre><code>&lt;hr /&gt;
</code></pre>
<p>Hr's:</p>
<hr>
@@ -315,14 +315,14 @@ Blah
<p>So is <strong><em>this</em></strong> word.</p>
<p><strong><em>This is strong and em.</em></strong></p>
<p>So is <strong><em>this</em></strong> word.</p>
-<p>This is code: <code>></code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html></code>.</p>
+<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.</p>
<hr />
<h1>Smart quotes, ellipses, dashes</h1>
-<p>"Hello," said the spider. "'Shelob' is my name."</p>
+<p>&quot;Hello,&quot; said the spider. &quot;'Shelob' is my name.&quot;</p>
<p>'A', 'B', and 'C' are letters.</p>
<p>'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'</p>
-<p>'He said, "I want to go."' Were you alive in the 70's?</p>
-<p>Here is some quoted '<code>code</code>' and a "<a href="http://example.com/?foo=1&amp;bar=2">quoted link</a>".</p>
+<p>'He said, &quot;I want to go.&quot;' Were you alive in the 70's?</p>
+<p>Here is some quoted '<code>code</code>' and a &quot;<a href="http://example.com/?foo=1&amp;bar=2">quoted link</a>&quot;.</p>
<p>Some dashes: one---two --- three--four -- five.</p>
<p>Dashes between numbers: 5-7, 255-66, 1987-1999.</p>
<p>Ellipses...and. . .and . . . .</p>
@@ -342,7 +342,7 @@ Blah
<p>These shouldn't be math:</p>
<ul>
<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>
-<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if "lot" is emphasized.)</li>
+<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if &quot;lot&quot; is emphasized.)</li>
<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>
</ul>
<p>Here's a LaTeX table:</p>
@@ -355,11 +355,11 @@ Cat &amp; 1 \\ \hline
<h1>Special Characters</h1>
<p>Here is some unicode:</p>
<ul>
-<li>I hat: Î</li>
-<li>o umlaut: ö</li>
-<li>section: §</li>
-<li>set membership: ∈</li>
-<li>copyright: ©</li>
+<li>I hat: &Icirc;</li>
+<li>o umlaut: &ouml;</li>
+<li>section: &sect;</li>
+<li>set membership: &isin;</li>
+<li>copyright: &copy;</li>
</ul>
<p>AT&amp;T has an ampersand in their name.</p>
<p>AT&amp;T is another way to write it.</p>
@@ -414,7 +414,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>')
<p>Foo <a href="/url/" title="Title with &quot;quote&quot; inside">biz</a>.</p>
<h2>With ampersands</h2>
<p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</a>.</p>
-<p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&T">AT&amp;T</a>.</p>
+<p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
<p>Here's an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p>
<p>Here's an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p>
<h2>Autolinks</h2>
@@ -433,12 +433,12 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
<blockquote>
<p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
</blockquote>
-<p>Auto-links should not occur here: <code>&lt;http://example.com/></code></p>
-<pre><code>or here: &lt;http://example.com/>
+<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
+<pre><code>or here: &lt;http://example.com/&gt;
</code></pre>
<hr />
<h1>Images</h1>
-<p>From "Voyage dans la Lune" by Georges Melies (1902):</p>
+<p>From &quot;Voyage dans la Lune&quot; by Georges Melies (1902):</p>
<p><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"></p>
<p>Here is a movie <img src="movie.jpg" alt="movie"> icon.</p>
<hr />
@@ -458,7 +458,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
<a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li>
<li id="fn2"><p>Here's the long note. This one contains multiple blocks.</p>
<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
-<pre><code> { &lt;code> }
+<pre><code> { &lt;code&gt; }
</code></pre>
<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
<a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
diff --git a/tests/writer.smart.html b/tests/writer.smart.html
index c14a6de54..14b70e2fe 100644
--- a/tests/writer.smart.html
+++ b/tests/writer.smart.html
@@ -39,7 +39,7 @@ here.</p>
<blockquote>
<p>Code in a block quote:</p>
<pre><code>sub status {
- print "working";
+ print &quot;working&quot;;
}
</code></pre>
<p>A list:</p>
@@ -60,7 +60,7 @@ here.</p>
<blockquote>
<p>Example:</p>
<pre><code>sub status {
- print "working";
+ print &quot;working&quot;;
}
</code></pre>
</blockquote>
@@ -84,7 +84,7 @@ here.</p>
<pre><code>---- (should be four hyphens)
sub status {
- print "working";
+ print &quot;working&quot;;
}
this code block is indented by one tab
@@ -92,7 +92,7 @@ this code block is indented by one tab
<p>And:</p>
<pre><code> this code block is indented by two tabs
-These should not be escaped: \$ \\ \> \[ \{
+These should not be escaped: \$ \\ \&gt; \[ \{
</code></pre>
<hr />
<h1>Lists</h1>
@@ -255,12 +255,12 @@ These should not be escaped: \$ \\ \> \[ \{
<div>
foo</div>
<p>This should be a code block, though:</p>
-<pre><code>&lt;div>
+<pre><code>&lt;div&gt;
foo
-&lt;/div>
+&lt;/div&gt;
</code></pre>
<p>As should this:</p>
-<pre><code>&lt;div>foo&lt;/div>
+<pre><code>&lt;div&gt;foo&lt;/div&gt;
</code></pre>
<p>Now, nested:</p>
<div>
@@ -281,12 +281,12 @@ Blah
This is another comment.
-->
<p>Code block:</p>
-<pre><code>&lt;!-- Comment -->
+<pre><code>&lt;!-- Comment --&gt;
</code></pre>
<p>Just plain comment, with trailing spaces on the line:</p>
<!-- foo -->
<p>Code:</p>
-<pre><code>&lt;hr />
+<pre><code>&lt;hr /&gt;
</code></pre>
<p>Hr&rsquo;s:</p>
<hr>
@@ -315,7 +315,7 @@ Blah
<p>So is <strong><em>this</em></strong> word.</p>
<p><strong><em>This is strong and em.</em></strong></p>
<p>So is <strong><em>this</em></strong> word.</p>
-<p>This is code: <code>></code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html></code>.</p>
+<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.</p>
<hr />
<h1>Smart quotes, ellipses, dashes</h1>
<p>&ldquo;Hello,&rdquo; said the spider. &ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;</p>
@@ -355,11 +355,11 @@ Cat &amp; 1 \\ \hline
<h1>Special Characters</h1>
<p>Here is some unicode:</p>
<ul>
-<li>I hat: Î</li>
-<li>o umlaut: ö</li>
-<li>section: §</li>
-<li>set membership: ∈</li>
-<li>copyright: ©</li>
+<li>I hat: &Icirc;</li>
+<li>o umlaut: &ouml;</li>
+<li>section: &sect;</li>
+<li>set membership: &isin;</li>
+<li>copyright: &copy;</li>
</ul>
<p>AT&amp;T has an ampersand in their name.</p>
<p>AT&amp;T is another way to write it.</p>
@@ -389,7 +389,7 @@ Cat &amp; 1 \\ \hline
<p><a href="/url/" title="title">URL and title</a>.</p>
<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p>
<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p>
-<p><a href="/url/" title="title with &quot;quotes&quot; in it">URL and title</a></p>
+<p><a href="/url/" title="title with &ldquo;quotes&rdquo; in it">URL and title</a></p>
<p><a href="/url/" title="title with single quotes">URL and title</a></p>
<p><script type="text/javascript">
<!--
@@ -410,11 +410,11 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>')
<p>This should [not][] be a link.</p>
<pre><code>[not]: /url
</code></pre>
-<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.</p>
-<p>Foo <a href="/url/" title="Title with &quot;quote&quot; inside">biz</a>.</p>
+<p>Foo <a href="/url/" title="Title with &ldquo;quotes&rdquo; inside">bar</a>.</p>
+<p>Foo <a href="/url/" title="Title with &ldquo;quote&rdquo; inside">biz</a>.</p>
<h2>With ampersands</h2>
<p>Here&rsquo;s a <a href="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</a>.</p>
-<p>Here&rsquo;s a link with an amersand in the link text: <a href="http://att.com/" title="AT&T">AT&amp;T</a>.</p>
+<p>Here&rsquo;s a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
<p>Here&rsquo;s an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p>
<p>Here&rsquo;s an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p>
<h2>Autolinks</h2>
@@ -433,8 +433,8 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
<blockquote>
<p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
</blockquote>
-<p>Auto-links should not occur here: <code>&lt;http://example.com/></code></p>
-<pre><code>or here: &lt;http://example.com/>
+<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
+<pre><code>or here: &lt;http://example.com/&gt;
</code></pre>
<hr />
<h1>Images</h1>
@@ -458,7 +458,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
<a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li>
<li id="fn2"><p>Here&rsquo;s the long note. This one contains multiple blocks.</p>
<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
-<pre><code> { &lt;code> }
+<pre><code> { &lt;code&gt; }
</code></pre>
<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
<a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>