logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker
commit: 42503102ecfbddb225ba7e1ca810fbf886459b5b
parent: b273ee4b33463f11111c0cea3c14dfae3f08ba8e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri,  1 Mar 2019 23:04:32 +0100

AutoLinker.ParserTest: Add link_email/3

Diffstat:

Mtest/parser_test.exs10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/test/parser_test.exs b/test/parser_test.exs @@ -77,6 +77,16 @@ defmodule AutoLinker.ParserTest do end end + test "link_email/3" do + expected = "<a href=\"mailto:user@example.org\" class=\"auto-linker\">user@example.org</a>" + + assert link_email(true, "user@example.org", %{}) == + expected + + assert link_email(false, "user@example.org", %{}) == + "user@example.org" + end + def valid_number?([list], number) do assert List.last(list) == number end