git.iko.soy/typeable/pandoc
on master help sign in
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

commit27169438551c1edfb8a2251a70ae607a7db36b29 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 1 Jan 2007, 22:07 (20 years ago) parentae869a0
2 files changed+26−12
src/Text/Pandoc/Writers/Docbook.hs+1−1 tests/writer.docbook+25−11
src/Text/Pandoc/Writers/Docbook.hs+1−1
@@ -158,7 +158,7 @@ blockToDocbook options (Para lst) =
158158blockToDocbook options (BlockQuote blocks) =
159159 indentedInTags options "blockquote" (blocksToDocbook options blocks)
160160blockToDocbook options (CodeBlock str) =
161− text "<programlisting>" <> (cdata str) <> text "</programlisting>"
161+ text "<screen>\n" <> text (codeStringToXML str) <> text "\n</screen>"
162162blockToDocbook options (BulletList lst) =
163163 indentedInTags options "itemizedlist" $ listItemsToDocbook options lst
164164blockToDocbook options (OrderedList lst) =
tests/writer.docbook+25−11
@@ -87,9 +87,11 @@
8787 <para>
8888 Code in a block quote:
8989 </para>
90− <programlisting><![CDATA[sub status {
90+ <screen>
91+sub status {
9192 print "working";
92−}]]></programlisting>
93+}
94+</screen>
9395 <para>
9496 A list:
9597 </para>
@@ -129,9 +131,11 @@
129131 <para>
130132 Example:
131133 </para>
132− <programlisting><![CDATA[sub status {
134+ <screen>
135+sub status {
133136 print "working";
134−}]]></programlisting>
137+}
138+</screen>
135139 </blockquote>
136140 <blockquote>
137141 <orderedlist>
@@ -169,19 +173,23 @@
169173 <para>
170174 Code:
171175 </para>
172− <programlisting><![CDATA[---- (should be four hyphens)
176+ <screen>
177+---- (should be four hyphens)
173178
174179sub status {
175180 print "working";
176181}
177182
178−this code block is indented by one tab]]></programlisting>
183+this code block is indented by one tab
184+</screen>
179185 <para>
180186 And:
181187 </para>
182− <programlisting><![CDATA[ this code block is indented by two tabs
188+ <screen>
189+ this code block is indented by two tabs
183190
184−These should not be escaped: \$ \\ \> \[ \{]]></programlisting>
191+These should not be escaped: \$ \\ \> \[ \{
192+</screen>
185193 </section>
186194 <section>
187195 <title>Lists</title>
@@ -839,7 +847,9 @@ Cat &amp; 1 \\ \hline
839847 <para>
840848 This should [not][] be a link.
841849 </para>
842− <programlisting><![CDATA[[not]: /url]]></programlisting>
850+ <screen>
851+[not]: /url
852+</screen>
843853 <para>
844854 Foo <ulink url="/url/">bar</ulink>.
845855 </para>
@@ -901,7 +911,9 @@ Cat &amp; 1 \\ \hline
901911 Auto-links should not occur here:
902912 <literal>&lt;http://example.com/></literal>
903913 </para>
904− <programlisting><![CDATA[or here: <http://example.com/>]]></programlisting>
914+ <screen>
915+or here: &lt;http://example.com/>
916+</screen>
905917 </section>
906918 </section>
907919 <section>
@@ -950,7 +962,9 @@ Cat &amp; 1 \\ \hline
950962 Subsequent blocks are indented to show that they belong to the
951963 footnote (as with list items).
952964 </para>
953− <programlisting><![CDATA[ { <code> }]]></programlisting>
965+ <screen>
966+ { &lt;code> }
967+</screen>
954968 <para>
955969 If you want, you can indent every line, but you can also be lazy
956970 and just indent the first line of each block.