Skip to content

Commit 83346ec

Browse files
committed
fix: Strip return carriage for windows compatability
1 parent 6c27133 commit 83346ec

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Sabela/Output.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ parseMarker l =
9494

9595
parseMimeOutputs :: Text -> [(Text, Text)]
9696
parseMimeOutputs raw =
97-
let ls = T.lines raw
97+
let ls = map (T.dropWhileEnd (== '\r')) (T.lines raw)
9898
(finalMime, finalLines, acc) = foldl step ("text/plain", [], []) ls
9999
finalBlock = T.unlines (reverse finalLines)
100100
result =

src/Sabela/Server/Notebook.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ loadNotebookH app _rn (LoadRequest path) = liftIO $ do
8282
putStrLn $ "[sabela] load rejected (path outside workspace): " ++ path
8383
readNotebook (appNotebook app)
8484
Just absPath -> do
85-
raw <- TIO.readFile absPath
85+
raw <- fmap (T.replace "\r\n" "\n") (TIO.readFile absPath)
8686
cells <-
8787
mapM
8888
(segmentToCell (appNotebook app))

0 commit comments

Comments
 (0)