From fe1d147187db852d2eeacd3e40d3e81d197180a4 Mon Sep 17 00:00:00 2001
From: Bryan O'Sullivan <bos@serpentine.com>
Date: Mon, 8 Dec 2014 23:12:06 -0800
Subject: [PATCH 1/3] DocBook reader: add support for classname

---
 src/Text/Pandoc/Readers/DocBook.hs | 3 ++-
 tests/docbook-reader.docbook       | 3 +++
 tests/docbook-reader.native        | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index 463376ef0..6117d6867 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -81,7 +81,7 @@ List of all DocBook tags, with [x] indicating implemented,
 [ ] citerefentry - A citation to a reference page
 [ ] citetitle - The title of a cited work
 [ ] city - The name of a city in an address
-[ ] classname - The name of a class, in the object-oriented programming sense
+[x] classname - The name of a class, in the object-oriented programming sense
 [ ] classsynopsis - The syntax summary for a class definition
 [ ] classsynopsisinfo - Information supplementing the contents of
     a ClassSynopsis
@@ -903,6 +903,7 @@ parseInline (Elem e) =
                         else doubleQuoted contents
         "simplelist" -> simpleList
         "segmentedlist" -> segmentedList
+        "classname" -> codeWithLang
         "code" -> codeWithLang
         "filename" -> codeWithLang
         "literal" -> codeWithLang
diff --git a/tests/docbook-reader.docbook b/tests/docbook-reader.docbook
index 8fe2a6ddb..68689645a 100644
--- a/tests/docbook-reader.docbook
+++ b/tests/docbook-reader.docbook
@@ -709,6 +709,9 @@ These should not be escaped:  \$ \\ \&gt; \[ \{
     <literal>\</literal>, <literal>\$</literal>,
     <literal>&lt;html&gt;</literal>.
   </para>
+  <para>
+    More code: <classname>Class</classname>
+  </para>
   <para>
     <emphasis role="strikethrough">This is
     <emphasis>strikeout</emphasis>.</emphasis>
diff --git a/tests/docbook-reader.native b/tests/docbook-reader.native
index 7edc15570..2a89c2779 100644
--- a/tests/docbook-reader.native
+++ b/tests/docbook-reader.native
@@ -185,6 +185,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
 ,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
 ,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
 ,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
+,Para [Str "More",Space,Str "code:",Space,Str "Class"]
 ,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]]
 ,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello\160there"],Str "."]
 ,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many\160of\160them"],Str "O."]

From aaf93d8f4e8d8020c9c5cb453d6cdfcf89da8b02 Mon Sep 17 00:00:00 2001
From: Bryan O'Sullivan <bos@serpentine.com>
Date: Mon, 8 Dec 2014 23:16:21 -0800
Subject: [PATCH 2/3] Fix test suite

---
 tests/docbook-reader.native | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/docbook-reader.native b/tests/docbook-reader.native
index 2a89c2779..a27e65757 100644
--- a/tests/docbook-reader.native
+++ b/tests/docbook-reader.native
@@ -185,7 +185,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
 ,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
 ,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
 ,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
-,Para [Str "More",Space,Str "code:",Space,Str "Class"]
+,Para [Str "More",Space,Str "code:",Space,Code ("",[],[]) "Class"]
 ,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]]
 ,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello\160there"],Str "."]
 ,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many\160of\160them"],Str "O."]

From 2150903230d1de3d0632205efc7f77e978c8177e Mon Sep 17 00:00:00 2001
From: Bryan O'Sullivan <bos@serpentine.com>
Date: Mon, 8 Dec 2014 23:17:27 -0800
Subject: [PATCH 3/3] DocBook reader: document/test "type" as implemented

---
 src/Text/Pandoc/Readers/DocBook.hs | 2 +-
 tests/docbook-reader.docbook       | 2 +-
 tests/docbook-reader.native        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index 6117d6867..e79f7d1fa 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -471,7 +471,7 @@ List of all DocBook tags, with [x] indicating implemented,
 [ ] token - A unit of information
 [x] tr - A row in an HTML table
 [ ] trademark - A trademark
-[ ] type - The classification of a value
+[x] type - The classification of a value
 [x] ulink - A link that addresses its target by means of a URL
     (Uniform Resource Locator)
 [x] uri - A Uniform Resource Identifier
diff --git a/tests/docbook-reader.docbook b/tests/docbook-reader.docbook
index 68689645a..cf5059646 100644
--- a/tests/docbook-reader.docbook
+++ b/tests/docbook-reader.docbook
@@ -710,7 +710,7 @@ These should not be escaped:  \$ \\ \&gt; \[ \{
     <literal>&lt;html&gt;</literal>.
   </para>
   <para>
-    More code: <classname>Class</classname>
+    More code: <classname>Class</classname> and <type>Type</type>
   </para>
   <para>
     <emphasis role="strikethrough">This is
diff --git a/tests/docbook-reader.native b/tests/docbook-reader.native
index a27e65757..319f992bd 100644
--- a/tests/docbook-reader.native
+++ b/tests/docbook-reader.native
@@ -185,7 +185,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
 ,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
 ,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
 ,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "<html>",Str "."]
-,Para [Str "More",Space,Str "code:",Space,Code ("",[],[]) "Class"]
+,Para [Str "More",Space,Str "code:",Space,Code ("",[],[]) "Class",Space,Str "and",Space,Code ("",[],[]) "Type"]
 ,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]]
 ,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello\160there"],Str "."]
 ,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many\160of\160them"],Str "O."]