diff options
Diffstat (limited to 'server/src/Thermoprint/Server/Printer')
-rw-r--r-- | server/src/Thermoprint/Server/Printer/Debug.hs | 2 | ||||
-rw-r--r-- | server/src/Thermoprint/Server/Printer/Generic.hs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/src/Thermoprint/Server/Printer/Debug.hs b/server/src/Thermoprint/Server/Printer/Debug.hs index d7ee12a..b8580b8 100644 --- a/server/src/Thermoprint/Server/Printer/Debug.hs +++ b/server/src/Thermoprint/Server/Printer/Debug.hs | |||
@@ -26,7 +26,7 @@ debugPrint :: PrinterMethod | |||
26 | debugPrint = PM $ (>> return Nothing) . $(logDebugS) "Printer.Debug" . T.pack . show . cotext' | 26 | debugPrint = PM $ (>> return Nothing) . $(logDebugS) "Printer.Debug" . T.pack . show . cotext' |
27 | 27 | ||
28 | cotext' :: Printout -> Text | 28 | cotext' :: Printout -> Text |
29 | cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList) . toList | 29 | cotext' = mconcat . intersperse "\n\n" . map (mconcat . map cotext'' . toList . getChunks) . toList . getParagraphs |
30 | where | 30 | where |
31 | cotext'' (Cooked b) = cotext b | 31 | cotext'' (Cooked b) = cotext b |
32 | cotext'' (Raw _) = "[Raw]" | 32 | cotext'' (Raw _) = "[Raw]" |
diff --git a/server/src/Thermoprint/Server/Printer/Generic.hs b/server/src/Thermoprint/Server/Printer/Generic.hs index df84e06..f431e4f 100644 --- a/server/src/Thermoprint/Server/Printer/Generic.hs +++ b/server/src/Thermoprint/Server/Printer/Generic.hs | |||
@@ -114,10 +114,10 @@ intersperse' :: Monad m => m b -> (a -> m b) -> Seq a -> m () | |||
114 | intersperse' b f = sequence_ . intersperse b f | 114 | intersperse' b f = sequence_ . intersperse b f |
115 | 115 | ||
116 | render :: Printout -> Put | 116 | render :: Printout -> Put |
117 | render = intersperse' (newls' 2) renderPar | 117 | render = intersperse' (newls' 2) renderPar . getParagraphs |
118 | 118 | ||
119 | renderPar :: Paragraph -> Put | 119 | renderPar :: Paragraph -> Put |
120 | renderPar = mapM_ renderChunk | 120 | renderPar = mapM_ renderChunk . getChunks |
121 | where | 121 | where |
122 | renderChunk (Raw bs) = mapM_ pushWord8 $ LBS.unpack bs | 122 | renderChunk (Raw bs) = mapM_ pushWord8 $ LBS.unpack bs |
123 | renderChunk (Cooked block) = renderDoc $ execState (renderBlock block) (initDoc width) | 123 | renderChunk (Cooked block) = renderDoc $ execState (renderBlock block) (initDoc width) |