add md lists support
This commit is contained in:
parent
fafff120f9
commit
496d3667de
3 changed files with 64 additions and 12 deletions
|
@ -28,6 +28,48 @@ in with md; [
|
|||
expected = elems.code code;
|
||||
}))
|
||||
|
||||
(it "matches a list of one element" (
|
||||
{
|
||||
actual = list ''
|
||||
- something
|
||||
'';
|
||||
expected = { matched = true; block = elems.List ["something\n"];};
|
||||
}))
|
||||
|
||||
(it "matches a list of many elements" (
|
||||
{
|
||||
actual = list ''
|
||||
- something
|
||||
- something else
|
||||
'';
|
||||
expected = { matched = true; block = elems.List ["something\n" "something else\n"];};
|
||||
}))
|
||||
|
||||
(it "matches a list with no whitespace around" (
|
||||
{
|
||||
actual = list
|
||||
"- something\n- something else";
|
||||
expected = { matched = true; block = elems.List ["something\n" "something else"];};
|
||||
}))
|
||||
|
||||
|
||||
(it "doesnt match not a list" (
|
||||
let
|
||||
str = "blah blah";
|
||||
in
|
||||
{
|
||||
actual = list str;
|
||||
expected = { matched = false; block = str;};
|
||||
}))
|
||||
|
||||
(it "makes a list" (
|
||||
{
|
||||
actual = mdBlock ''
|
||||
- something
|
||||
'';
|
||||
expected = elems.List ["something\n"];
|
||||
}))
|
||||
|
||||
(it "processes md block" {
|
||||
actual = readMd ''
|
||||
# foo bar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue