Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get CommonMark 0.30 tests to pass for "Fenced code blocks" section #822

Open
DavidSSL opened this issue Apr 25, 2023 · 0 comments
Open

Get CommonMark 0.30 tests to pass for "Fenced code blocks" section #822

DavidSSL opened this issue Apr 25, 2023 · 0 comments

Comments

@DavidSSL
Copy link

DavidSSL commented Apr 25, 2023

This is very similar to #821 and also originates from #90.

When using the CommonMark version 0.30 test cases, the following battery of tests

[<Test>]
[<TestCaseSource("getTests")>]
let ``Commonmark specification`` (_section: string) (markdown: string) (html: string) =
printfn "Markdown: '%s'" markdown
(Markdown.ToHtml(markdown, "\n")) |> should equal html

, experience the problem that some of the tests start failing.

The aim would be to ensure that the tests falling under the Fenced code blocks section to pass.

One of the tests is failing as:

Expected string length 26 but was 25. Strings differ at index 9.
Expected: "<p><code> </code>\naaa</p>\n"
But was:  "<p><code></code>\naaa</p>\n"

and this is caused by toCharArray here:

let parseSpans (StringPosition.TrimBoth(s, n)) ctx =
let ctx = { ctx with CurrentRange = Some(n) }
parseChars [] (s.ToCharArray() |> List.ofArray) ctx |> List.ofSeq

which is "trimming" the whitespace character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant