summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-03-21 15:45:54 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-03-21 15:45:54 +0000
commit4988441f3c44d8b80712aec8eb3359a3a584e669 (patch)
tree26a669eb04e04e5977fe458e1cb2c9cc7720f102
parentc2e207a1f65dc128c2fe1db6c3fa529762512ce1 (diff)
Fixed handling of Quoted inline elements to use unicode left & right quotes.
Added inQuotes auxiliary function. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1261 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Text/Pandoc/Writers/OpenDocument.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Text/Pandoc/Writers/OpenDocument.hs b/Text/Pandoc/Writers/OpenDocument.hs
index 827aa30e6..f956c1fb8 100644
--- a/Text/Pandoc/Writers/OpenDocument.hs
+++ b/Text/Pandoc/Writers/OpenDocument.hs
@@ -94,6 +94,10 @@ inHeaderTags :: Int -> Doc -> Doc
inHeaderTags i = inTags False "text:h" [ ("text:style-name", "Heading_20_" ++ show i)
, ("text:outline-level", show i)]
+inQuotes :: QuoteType -> Doc -> Doc
+inQuotes SingleQuote s = text "&#8216;" <> s <> text "&#8217;"
+inQuotes DoubleQuote s = text "&#8220;" <> s <> text "&#8221;"
+
-- | Convert list of authors to a docbook <author> section
authorToOpenDocument :: [Char] -> Doc
authorToOpenDocument name =
@@ -297,7 +301,7 @@ inlineToOpenDocument o ils
| Ellipses <- ils = return $ text "&#8230;"
| EmDash <- ils = return $ text "&#8212;"
| EnDash <- ils = return $ text "&#8211;"
- | Apostrophe <- ils = return $ char '\''
+ | Apostrophe <- ils = return $ text "&#8217;"
| Space <- ils = return $ char ' '
| LineBreak <- ils = return $ selfClosingTag "text:line-break" []
| Str s <- ils = return $ text $ escapeStringForXML s
@@ -306,7 +310,7 @@ inlineToOpenDocument o ils
| Strikeout l <- ils = inSpanTags "Strikeout" <$> inlinesToOpenDocument o l
| Superscript l <- ils = inSpanTags "Superscript" <$> inlinesToOpenDocument o l
| Subscript l <- ils = inSpanTags "Subscript" <$> inlinesToOpenDocument o l
- | Quoted _ l <- ils = inSpanTags "Citation" <$> inlinesToOpenDocument o l
+ | Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
| Code s <- ils = preformatted s
| Math s <- ils = inlinesToOpenDocument o (readTeXMath s)
| TeX s <- ils = preformatted s