logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker
commit: 48aed6ba6192ffd9426efa30e71b8c450e8db446
parent: 4da0c84ba120b4c9a357b839304d9bfad3dafe82
Author: Egor Kislitsyn <egor@kislitsyn.com>
Date:   Fri,  8 Feb 2019 16:10:02 +0700

rename link_and_parse -> link_map

Diffstat:

Mlib/auto_linker.ex4++--
Mtest/auto_linker_test.exs4++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/auto_linker.ex b/lib/auto_linker.ex @@ -54,7 +54,7 @@ defmodule AutoLinker do parse({text, nil}, opts) |> elem(0) end - def link_and_parse(text, parsed, opts \\ []) do - parse({text, parsed}, opts) + def link_map(text, acc, opts \\ []) do + parse({text, acc}, opts) end end diff --git a/test/auto_linker_test.exs b/test/auto_linker_test.exs @@ -66,7 +66,7 @@ defmodule AutoLinkerTest do end {result_text, %{mentions: mentions}} = - AutoLinker.link_and_parse(text, %{mentions: MapSet.new()}, + AutoLinker.link_map(text, %{mentions: MapSet.new()}, mention: true, mention_handler: handler ) @@ -86,7 +86,7 @@ defmodule AutoLinkerTest do end {result_text, %{tags: tags}} = - AutoLinker.link_and_parse(text, %{tags: MapSet.new()}, + AutoLinker.link_map(text, %{tags: MapSet.new()}, hashtag: true, hashtag_handler: handler, hashtag_prefix: "https://example.com/user/",