diff options
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 6 | ||||
-rw-r--r-- | tests/writer.docbook | 44 |
2 files changed, 25 insertions, 25 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 1ca76bfd6..29c042cf9 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -147,9 +147,9 @@ blockToDocbook opts (Para lst) = inTagsIndented "para" $ inlinesToDocbook opts lst blockToDocbook opts (BlockQuote blocks) = inTagsIndented "blockquote" $ blocksToDocbook opts blocks -blockToDocbook _ (CodeBlock (_,classes,_) str) = - text ("<screen" ++ lang ++ ">") <> cr <> - flush (text (escapeStringForXML str) <> cr <> text "</screen>") +blockToDocbook _ (CodeBlock (_,classes,_) str) = + text ("<programlisting" ++ lang ++ ">") <> cr <> + flush (text (escapeStringForXML str) <> cr <> text "</programlisting>") where lang = if null langs then "" else " language=\"" ++ escapeStringForXML (head langs) ++ diff --git a/tests/writer.docbook b/tests/writer.docbook index e7e948288..780775d0f 100644 --- a/tests/writer.docbook +++ b/tests/writer.docbook @@ -84,11 +84,11 @@ <para> Code in a block quote: </para> - <screen> + <programlisting> sub status { print "working"; } -</screen> +</programlisting> <para> A list: </para> @@ -130,7 +130,7 @@ sub status { <para> Code: </para> - <screen> + <programlisting> ---- (should be four hyphens) sub status { @@ -138,15 +138,15 @@ sub status { } this code block is indented by one tab -</screen> +</programlisting> <para> And: </para> - <screen> + <programlisting> this code block is indented by two tabs These should not be escaped: \$ \\ \> \[ \{ -</screen> +</programlisting> </section> <section id="lists"> <title>Lists</title> @@ -742,9 +742,9 @@ These should not be escaped: \$ \\ \> \[ \{ <para> orange fruit </para> - <screen> + <programlisting> { orange code block } -</screen> +</programlisting> <blockquote> <para> orange block quote @@ -902,17 +902,17 @@ These should not be escaped: \$ \\ \> \[ \{ <para> This should be a code block, though: </para> - <screen> + <programlisting> <div> foo </div> -</screen> +</programlisting> <para> As should this: </para> - <screen> + <programlisting> <div>foo</div> -</screen> +</programlisting> <para> Now, nested: </para> @@ -942,9 +942,9 @@ These should not be escaped: \$ \\ \> \[ \{ <para> Code block: </para> - <screen> + <programlisting> <!-- Comment --> -</screen> +</programlisting> <para> Just plain comment, with trailing spaces on the line: </para> @@ -952,9 +952,9 @@ These should not be escaped: \$ \\ \> \[ \{ <para> Code: </para> - <screen> + <programlisting> <hr /> -</screen> +</programlisting> <para> Hr's: </para> @@ -1291,9 +1291,9 @@ These should not be escaped: \$ \\ \> \[ \{ <para> This should [not][] be a link. </para> - <screen> + <programlisting> [not]: /url -</screen> +</programlisting> <para> Foo <ulink url="/url/">bar</ulink>. </para> @@ -1355,9 +1355,9 @@ These should not be escaped: \$ \\ \> \[ \{ Auto-links should not occur here: <literal><http://example.com/></literal> </para> - <screen> + <programlisting> or here: <http://example.com/> -</screen> +</programlisting> </section> </section> <section id="images"> @@ -1398,9 +1398,9 @@ or here: <http://example.com/> Subsequent blocks are indented to show that they belong to the footnote (as with list items). </para> - <screen> + <programlisting> { <code> } -</screen> +</programlisting> <para> If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. |