cdepillabout/pretty-simple

Empty string in `stdout` instead of using handle

Lev135 opened this issue · 1 comments

As far as I understood pHPrint prints eoln at the end using putStrLn, not in handle. It was very suprising for me. Why it's do so? Is it a bug or a feature?

pHPrintStringOpt checkColorTty outputOptions Handle
handle str = do
  realOutputOpts <-
    case checkColorTty of
      CheckColorTty -> hCheckTTY handle outputOptions
      NoCheckColorTty -> pure outputOptions
  liftIO $ do
    renderIO handle $ layoutStringAnsi realOutputOpts str
    putStrLn ""

I've found it while rendering in file using pHPrint and these empty lines surprised me

@Lev135 Thanks for submitting this issue!

This is very likely a bug. Would you be able to send a PR fixing this?