diff options
-rw-r--r-- | src/Text/Pandoc/Writers/OpenDocument.hs | 6 | ||||
-rw-r--r-- | tests/writer.opendocument | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 4e3979c07..0e8a8bf8b 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -112,7 +112,9 @@ setInDefinitionList :: Bool -> State WriterState () setInDefinitionList b = modify $ \s -> s { stInDefinition = b } inParagraphTags :: Doc -> Doc -inParagraphTags = inTags False "text:p" [("text:style-name", "Text_20_body")] +inParagraphTags d | isEmpty d = empty +inParagraphTags d = + inTags False "text:p" [("text:style-name", "Text_20_body")] d inParagraphTagsWithStyle :: String -> Doc -> Doc inParagraphTagsWithStyle sty = inTags False "text:p" [("text:style-name", sty)] @@ -359,7 +361,7 @@ inlineToOpenDocument o ils | Code s <- ils = preformatted s | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s) | Cite _ l <- ils = inlinesToOpenDocument o l - | TeX s <- ils = preformatted s + | TeX _ <- ils = return empty | HtmlInline s <- ils = preformatted s | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l | Image _ (s,_) <- ils = return $ mkImg s diff --git a/tests/writer.opendocument b/tests/writer.opendocument index a08e5cf0a..179d29ac9 100644 --- a/tests/writer.opendocument +++ b/tests/writer.opendocument @@ -1301,7 +1301,7 @@ <text:h text:style-name="Heading_20_1" text:outline-level="1">LaTeX</text:h> <text:list text:style-name="L26"> <text:list-item> - <text:p text:style-name="P51"><text:span text:style-name="Teletype">\cite[22-23]{smith.1899}</text:span></text:p> + <text:p text:style-name="P51"></text:p> </text:list-item> <text:list-item> <text:p text:style-name="P51">2 + 2 = 4</text:p> @@ -1341,11 +1341,6 @@ </text:list-item> </text:list> <text:p text:style-name="Text_20_body">Here’s a LaTeX table:</text:p> -<text:p text:style-name="Text_20_body"><text:span text:style-name="Teletype">\begin{tabular}{|l|l|}\hline -Animal & Number \\ \hline -Dog <text:s text:c="3" />& 2 <text:s text:c="5" />\\ -Cat <text:s text:c="3" />& 1 <text:s text:c="5" />\\ \hline -\end{tabular}</text:span></text:p> <text:p text:style-name="Horizontal_20_Line" /> <text:h text:style-name="Heading_20_1" text:outline-level="1">Special Characters</text:h> <text:p text:style-name="Text_20_body">Here is some unicode:</text:p> |