Skip to content

Commit

Permalink
Fix formatting and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shonfeder committed Nov 21, 2022
1 parent 7ad1297 commit e7f3038
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/omd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ let parse_inlines (md, defs) : doc =

let of_channel ic : doc = parse_inlines (Block_parser.Pre.of_channel ic)
let of_string s = parse_inlines (Block_parser.Pre.of_string s)
let to_html ?auto_identifiers doc = Html.to_string (Html.of_doc ?auto_identifiers doc)

let to_html ?auto_identifiers doc =
Html.to_string (Html.of_doc ?auto_identifiers doc)

let to_sexp ast = Format.asprintf "@[%a@]@." Sexp.print (Sexp.create ast)
5 changes: 3 additions & 2 deletions tests/expect_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ let%expect_test "construct inline elements" =

let%expect_test "construct headings" =
show Omd.Ctor.[ h 1 ~attrs:[ ("class", "my-class") ] [ txt "Heading 1" ] ];
[%expect {| <h1 class="my-class">Heading 1</h1> |}];
[%expect {| <h1 id="heading-1" class="my-class">Heading 1</h1> |}];
show Omd.Ctor.[ h 6 [ txt "Heading 6"; em "with emphasis!" ] ];
[%expect {| <h6>Heading 6<em>with emphasis!</em></h6> |}]
[%expect
{| <h6 id="heading-6with-emphasis">Heading 6<em>with emphasis!</em></h6> |}]

let%expect_test "construct lists" =
show
Expand Down

0 comments on commit e7f3038

Please sign in to comment.