aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-09-24 19:56:55 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-09-24 19:56:55 -0700
commitb97f1136cd089c17123a264a8b3e0fcf657fc5fc (patch)
tree8b7e63c03a63682aa39ac1d0ea29bb402503a313 /src/Text
parentf9430e995eaca8eb9f92d470de703e998197b26f (diff)
parenta117a881379ca2863bb9adb39cd83a6c4003be56 (diff)
downloadpandoc-b97f1136cd089c17123a264a8b3e0fcf657fc5fc.tar.gz
Merge branch 'master' of github.com:jgm/pandoc
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 3ec5c2073..206be7133 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -373,18 +373,18 @@ inlineToOpenDocument o ils
| Subscript l <- ils = withTextStyle Sub $ inlinesToOpenDocument o l
| SmallCaps l <- ils = withTextStyle SmallC $ inlinesToOpenDocument o l
| Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
- | Code _ s <- ils = preformatted s
+ | Code _ s <- ils = withTextStyle Pre $ inTextStyle $ preformatted s
| Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
| Cite _ l <- ils = inlinesToOpenDocument o l
| RawInline f s <- ils = if f == "opendocument" || f == "html"
- then preformatted s
+ then withTextStyle Pre $ inTextStyle $ preformatted s
else return empty
| Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
| Image _ (s,t) <- ils = return $ mkImg s t
| Note l <- ils = mkNote l
| otherwise = return empty
where
- preformatted = return . inSpanTags "Teletype" . handleSpaces . escapeStringForXML
+ preformatted s = handleSpaces $ escapeStringForXML s
mkLink s t = inTags False "text:a" [ ("xlink:type" , "simple")
, ("xlink:href" , s )
, ("office:name", t )
@@ -524,7 +524,8 @@ paraTableStyles t s (a:xs)
[ ("fo:text-align", x)
, ("style:justify-single-word", "false")]
-data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC deriving ( Eq,Ord )
+data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC | Pre
+ deriving ( Eq,Ord )
textStyleAttr :: TextStyle -> [(String,String)]
textStyleAttr s
@@ -538,5 +539,8 @@ textStyleAttr s
| Sub <- s = [("style:text-position" ,"sub 58%" )]
| Sup <- s = [("style:text-position" ,"super 58%" )]
| SmallC <- s = [("fo:font-variant" ,"small-caps")]
+ | Pre <- s = [("style:font-name" ,"Courier New")
+ ,("style:font-name-asian" ,"Courier New")
+ ,("style:font-name-complex" ,"Courier New")]
| otherwise = []