git.iko.soy/typeable/pandoc
on master help sign in
Fixed handling of Quoted inline elements to use unicode left & right quotes.
4988441fiddlosopher
Text/Pandoc/Writers/OpenDocument.hs+6−2
@@ -94,6 +94,10 @@ inHeaderTags :: Int -> Doc -> Doc
94inHeaderTags i = inTags False "text:h" [ ("text:style-name", "Heading_20_" ++ show i)
94inHeaderTags i = inTags False "text:h" [ ("text:style-name", "Heading_20_" ++ show i)
95 , ("text:outline-level", show i)]
95 , ("text:outline-level", show i)]
96
96
97+inQuotes :: QuoteType -> Doc -> Doc
98+inQuotes SingleQuote s = text "&#8216;" <> s <> text "&#8217;"
99+inQuotes DoubleQuote s = text "&#8220;" <> s <> text "&#8221;"
100+
97-- | Convert list of authors to a docbook <author> section
101-- | Convert list of authors to a docbook <author> section
98authorToOpenDocument :: [Char] -> Doc
102authorToOpenDocument :: [Char] -> Doc
99authorToOpenDocument name =
103authorToOpenDocument name =
@@ -297,7 +301,7 @@ inlineToOpenDocument o ils
297 | Ellipses <- ils = return $ text "&#8230;"
301 | Ellipses <- ils = return $ text "&#8230;"
298 | EmDash <- ils = return $ text "&#8212;"
302 | EmDash <- ils = return $ text "&#8212;"
299 | EnDash <- ils = return $ text "&#8211;"
303 | EnDash <- ils = return $ text "&#8211;"
300− | Apostrophe <- ils = return $ char '\''
304+ | Apostrophe <- ils = return $ text "&#8217;"
301 | Space <- ils = return $ char ' '
305 | Space <- ils = return $ char ' '
302 | LineBreak <- ils = return $ selfClosingTag "text:line-break" []
306 | LineBreak <- ils = return $ selfClosingTag "text:line-break" []
303 | Str s <- ils = return $ text $ escapeStringForXML s
307 | Str s <- ils = return $ text $ escapeStringForXML s
@@ -306,7 +310,7 @@ inlineToOpenDocument o ils
306 | Strikeout l <- ils = inSpanTags "Strikeout" <$> inlinesToOpenDocument o l
310 | Strikeout l <- ils = inSpanTags "Strikeout" <$> inlinesToOpenDocument o l
307 | Superscript l <- ils = inSpanTags "Superscript" <$> inlinesToOpenDocument o l
311 | Superscript l <- ils = inSpanTags "Superscript" <$> inlinesToOpenDocument o l
308 | Subscript l <- ils = inSpanTags "Subscript" <$> inlinesToOpenDocument o l
312 | Subscript l <- ils = inSpanTags "Subscript" <$> inlinesToOpenDocument o l
309− | Quoted _ l <- ils = inSpanTags "Citation" <$> inlinesToOpenDocument o l
313+ | Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
310 | Code s <- ils = preformatted s
314 | Code s <- ils = preformatted s
311 | Math s <- ils = inlinesToOpenDocument o (readTeXMath s)
315 | Math s <- ils = inlinesToOpenDocument o (readTeXMath s)
312 | TeX s <- ils = preformatted s
316 | TeX s <- ils = preformatted s