Skip to content

Commit 3db1fbf

Browse files
committed
try a fix for linux line endings test fail
1 parent 4884263 commit 3db1fbf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/FSharp.Formatting.Literate/ParsePynb.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace FSharp.Formatting.Literate
33
open System.IO
44
open System.Text.Json
55
open FSharp.Formatting.Templating
6+
open FSharp.Formatting.PynbModel
67

78
module internal ParsePynb =
89

@@ -17,7 +18,7 @@ module internal ParsePynb =
1718
match this with
1819
| Markdown source -> source
1920
| Code code ->
20-
let codeBlock = sprintf $"```{code.lang}\n{code.source}\n```"
21+
let codeBlock = sprintf $"```{code.lang}\n{addLineEnd code.source}```"
2122

2223
match code.outputs with
2324
| None -> codeBlock
@@ -142,7 +143,7 @@ module internal ParsePynb =
142143

143144
json.RootElement.GetProperty("cells").EnumerateArray()
144145
|> Seq.map (parseCell >> (fun x -> x.ToMarkdown()))
145-
|> String.concat "\n\n"
146+
|> String.concat "\n"
146147

147148
let pynbToMarkdown ipynbFile =
148149
ipynbFile |> File.ReadAllText |> pynbStringToMarkdown

tests/FSharp.Literate.Tests/LiterateTests.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ let add a b = a + b
14651465
|> Literate.ToPynb
14661466
|> ParsePynb.pynbStringToMarkdown
14671467

1468-
mdOut |> shouldEqual mdIn
1468+
(mdOut.Trim()) |> shouldEqual (mdIn.Trim())
14691469

14701470
[<Test>]
14711471
let ``Script output is exactly right`` () =

0 commit comments

Comments
 (0)