summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:17:02 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:17:02 +0000
commit9eb4107af9529901fddd41ffc236af112af9d89f (patch)
treedea61d9f0147a25c4b6f5bd95f6d05d57023e412 /src/Text/Pandoc
parent2a9ac1e65a2e1c4617a937f1c6a79f551d8637c5 (diff)
Don't wrap text in OpenDocument writer.
The tags are so long that it's pointless. Use <> instead of $$ to prevent huge indents. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1730 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index df08146b3..6f716dd10 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -208,7 +208,7 @@ withParagraphStyle :: WriterOptions -> String -> [Block] -> State WriterState Do
withParagraphStyle o s (b:bs)
| Para l <- b = go =<< inParagraphTagsWithStyle s <$> inlinesToOpenDocument o l
| otherwise = go =<< blockToOpenDocument o b
- where go i = ($$) i <$> withParagraphStyle o s bs
+ where go i = (<>) i <$> withParagraphStyle o s bs
withParagraphStyle _ _ [] = return empty
inPreformattedTags :: String -> State WriterState Doc
@@ -288,9 +288,9 @@ blocksToOpenDocument o b = vcat <$> mapM (blockToOpenDocument o) b
-- | Convert a Pandoc block element to OpenDocument.
blockToOpenDocument :: WriterOptions -> Block -> State WriterState Doc
blockToOpenDocument o bs
- | Plain b <- bs = inParagraphTags <$> wrap o b
- | Para b <- bs = inParagraphTags <$> wrap o b
- | Header i b <- bs = inHeaderTags i <$> wrap o b
+ | Plain b <- bs = inParagraphTags <$> inlinesToOpenDocument o b
+ | Para b <- bs = inParagraphTags <$> inlinesToOpenDocument o b
+ | Header i b <- bs = inHeaderTags i <$> inlinesToOpenDocument o b
| BlockQuote b <- bs = mkBlockQuote b
| CodeBlock _ s <- bs = preformatted s
| RawHtml _ <- bs = return empty
@@ -353,12 +353,6 @@ tableItemToOpenDocument o tn (n,i) =
in inTags True "table:table-cell" a <$>
withParagraphStyle o n (map plainToPara i)
--- | Take list of inline elements and return wrapped doc.
-wrap :: WriterOptions -> [Inline] -> State WriterState Doc
-wrap o l = if writerWrapText o
- then fsep <$> mapM (inlinesToOpenDocument o) (splitBy Space l)
- else inlinesToOpenDocument o l
-
-- | Convert a list of inline elements to OpenDocument.
inlinesToOpenDocument :: WriterOptions -> [Inline] -> State WriterState Doc
inlinesToOpenDocument o l = hcat <$> mapM (inlineToOpenDocument o) l
@@ -405,7 +399,7 @@ inlineToOpenDocument o ils
let footNote t = inTags False "text:note"
[ ("text:id" , "ftn" ++ show n)
, ("text:note-class", "footnote" )] $
- inTagsSimple "text:note-citation" (text . show $ n + 1) $$
+ inTagsSimple "text:note-citation" (text . show $ n + 1) <>
inTagsSimple "text:note-body" t
nn <- footNote <$> withParagraphStyle o "Footnote" l
addNote nn