diff options
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/Native.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Native.hs b/src/Text/Pandoc/Writers/Native.hs index 3b5ea7481..cbda71555 100644 --- a/src/Text/Pandoc/Writers/Native.hs +++ b/src/Text/Pandoc/Writers/Native.hs @@ -29,7 +29,7 @@ Utility functions and definitions used by the various Pandoc modules. -} module Text.Pandoc.Writers.Native ( writeNative ) where -import Text.Pandoc.Shared ( WriterOptions ) +import Text.Pandoc.Shared ( WriterOptions(..) ) import Data.List ( intercalate ) import Text.Pandoc.Definition @@ -81,6 +81,9 @@ prettyBlock block = show block -- | Prettyprint Pandoc document. writeNative :: WriterOptions -> Pandoc -> String -writeNative _ (Pandoc meta blocks) = "Pandoc " ++ "(" ++ show meta ++ - ")\n" ++ (prettyBlockList 0 blocks) ++ "\n" - +writeNative opts (Pandoc meta blocks) | writerStandalone opts = + "Pandoc " ++ "(" ++ show meta ++ ")\n " ++ prettyBlockList 2 blocks +-- -- writeNative _ (Pandoc _ [Plain [x]]) = show x +-- writeNative _ (Pandoc _ [Plain xs]) = show xs +-- writeNative _ (Pandoc _ [x]) = prettyBlock x +writeNative _ (Pandoc _ xs) = prettyBlockList 0 xs |