diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-01-01 22:07:19 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-01-01 22:07:19 +0000 |
commit | 27169438551c1edfb8a2251a70ae607a7db36b29 (patch) | |
tree | 4e4c300a2a44806250502767f4c7b29fbdfa6bce | |
parent | ae869a092ac3f3f8c91b95b0d67910f96c491db5 (diff) | |
download | pandoc-27169438551c1edfb8a2251a70ae607a7db36b29.tar.gz |
Changed representation of code blocks to use <screen> and
escaped characters rather than <programlisting> and CDATA.
Reason: XML source more easily editable and readable.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@393 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 2 | ||||
-rw-r--r-- | tests/writer.docbook | 36 |
2 files changed, 26 insertions, 12 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index d025b7ac2..3916aa214 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -158,7 +158,7 @@ blockToDocbook options (Para lst) = blockToDocbook options (BlockQuote blocks) = indentedInTags options "blockquote" (blocksToDocbook options blocks) blockToDocbook options (CodeBlock str) = - text "<programlisting>" <> (cdata str) <> text "</programlisting>" + text "<screen>\n" <> text (codeStringToXML str) <> text "\n</screen>" blockToDocbook options (BulletList lst) = indentedInTags options "itemizedlist" $ listItemsToDocbook options lst blockToDocbook options (OrderedList lst) = diff --git a/tests/writer.docbook b/tests/writer.docbook index 2736bde74..3b3d661a3 100644 --- a/tests/writer.docbook +++ b/tests/writer.docbook @@ -87,9 +87,11 @@ <para> Code in a block quote: </para> - <programlisting><![CDATA[sub status { + <screen> +sub status { print "working"; -}]]></programlisting> +} +</screen> <para> A list: </para> @@ -129,9 +131,11 @@ <para> Example: </para> - <programlisting><![CDATA[sub status { + <screen> +sub status { print "working"; -}]]></programlisting> +} +</screen> </blockquote> <blockquote> <orderedlist> @@ -169,19 +173,23 @@ <para> Code: </para> - <programlisting><![CDATA[---- (should be four hyphens) + <screen> +---- (should be four hyphens) sub status { print "working"; } -this code block is indented by one tab]]></programlisting> +this code block is indented by one tab +</screen> <para> And: </para> - <programlisting><![CDATA[ this code block is indented by two tabs + <screen> + this code block is indented by two tabs -These should not be escaped: \$ \\ \> \[ \{]]></programlisting> +These should not be escaped: \$ \\ \> \[ \{ +</screen> </section> <section> <title>Lists</title> @@ -839,7 +847,9 @@ Cat & 1 \\ \hline <para> This should [not][] be a link. </para> - <programlisting><![CDATA[[not]: /url]]></programlisting> + <screen> +[not]: /url +</screen> <para> Foo <ulink url="/url/">bar</ulink>. </para> @@ -901,7 +911,9 @@ Cat & 1 \\ \hline Auto-links should not occur here: <literal><http://example.com/></literal> </para> - <programlisting><![CDATA[or here: <http://example.com/>]]></programlisting> + <screen> +or here: <http://example.com/> +</screen> </section> </section> <section> @@ -950,7 +962,9 @@ Cat & 1 \\ \hline Subsequent blocks are indented to show that they belong to the footnote (as with list items). </para> - <programlisting><![CDATA[ { <code> }]]></programlisting> + <screen> + { <code> } +</screen> <para> If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. |