add md code block support (basic)

This commit is contained in:
tristan 2024-01-01 14:06:54 +00:00
parent 3ceb580768
commit fafff120f9
3 changed files with 30 additions and 11 deletions

View file

@ -5,23 +5,29 @@ let
in with md; [
(it "gets md heading" {
actual = mdBlock ''
# title of the page'';
actual = mdBlock "# title of the page";
expected = elems.h1 "title of the page";
})
(it "gets md heading 2" {
actual = mdBlock ''
## a subheading'';
actual = mdBlock "## a subheading";
expected = elems.h2 "a subheading";
})
(it "limits to 6 #" {
actual = mdBlock ''
######## super ultra tiny heading'';
actual = mdBlock "######## super ultra tiny heading";
expected = elems.h6 "super ultra tiny heading";
})
(it "makes a code block" (
let code = ''
this is my code
''; in {
actual = mdBlock ''
```${code}```'';
expected = elems.code code;
}))
(it "processes md block" {
actual = readMd ''
# foo bar