Skip to content

Commit

Permalink
Add test of new wikilinks extension
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotto committed Feb 3, 2023
1 parent c26d2fa commit a6ecf55
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/panpipe/panpipe_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,17 @@ defmodule PanpipeTest do
use ExUnit.Case
doctest Panpipe

test "wiki links" do
assert Panpipe.ast_fragment!("[[Foo]]", from: {:markdown, [:wikilinks_title_after_pipe]}) == %Panpipe.AST.Link{
children: [%Panpipe.AST.Str{string: "Foo"}],
target: "Foo",
title: "wikilink"
}

assert Panpipe.ast_fragment!("[[Foo|title]]", from: {:markdown, [:wikilinks_title_after_pipe]}) == %Panpipe.AST.Link{
children: [%Panpipe.AST.Str{string: "title"}],
target: "Foo",
title: "wikilink"
}
end
end

0 comments on commit a6ecf55

Please sign in to comment.