Skip to content

Commit

Permalink
add commonmark link tests (#41)
Browse files Browse the repository at this point in the history
* add commonmark link tests

* Update test/md_test.exs

* Update test/md_test.exs

* Update test/md_test.exs

---------

Co-authored-by: Aleksei Matiushkin <[email protected]>
  • Loading branch information
dch and Aleksei Matiushkin authored May 3, 2024
1 parent 67909f2 commit 051efbc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/md_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,26 @@ defmodule MdTest do
# ] == Md.parse(input).ast
# end

test "deferred links" do
input = """
a [link][link]
[link]: https://example.com/
"""

assert [{:p, nil, ["a ", {:a, %{href: "https://example.com/"}, ["link"]}]}] ==
Md.parse(input).ast
end

test "complex links" do
input = """
[vxlan(4)](https://man.freebsd.org/vxlan)
"""

assert [{:a, %{href: "https://man.freebsd.org/vxlan"}, ["vxlan(4)"]}] ==
Md.parse(input).ast
end

test "tables" do
input = """
Hi,
Expand Down

0 comments on commit 051efbc

Please sign in to comment.