commit: 9052948b18ef5556b9d182624235f117225c95fd
parent: 540dd49853247a2ee443b10731d9b5bc60be5569
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 1 Mar 2019 23:26:36 +0100
mix.deps: Change Linkify to my branch
Diffstat:
6 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
@@ -16,7 +16,9 @@ defmodule Pleroma.Formatter do
hashtag: true,
hashtag_handler: &Pleroma.Formatter.hashtag_handler/4,
mention: true,
- mention_handler: &Pleroma.Formatter.mention_handler/4
+ mention_handler: &Pleroma.Formatter.mention_handler/4,
+ phone: false,
+ extra_prefixes: Pleroma.Config.get([:uri_schemes, :valid_schemes])
]
end
diff --git a/lib/pleroma/web/rich_media/helpers.ex b/lib/pleroma/web/rich_media/helpers.ex
@@ -14,7 +14,7 @@ defmodule Pleroma.Web.RichMedia.Helpers do
validate_tld = Pleroma.Config.get([Pleroma.Formatter, :validate_tld])
page_url
- |> Linkify.Parser.url?(validate_tld: validate_tld)
+ |> Linkify.Parser.url?(scheme: true, validate_tld: validate_tld)
|> parse_uri(page_url)
end
diff --git a/mix.exs b/mix.exs
@@ -158,7 +158,7 @@ defmodule Pleroma.Mixfile do
{:floki, "~> 0.27"},
{:timex, "~> 3.6"},
{:ueberauth, "~> 0.4"},
- {:linkify, "~> 0.2.0"},
+ {:linkify, git: "https://hacktivis.me/git/auto_linker.git", branch: "lanodan/master"},
{:http_signatures, "~> 0.1.0"},
{:telemetry, "~> 0.3"},
{:poolboy, "~> 1.5"},
diff --git a/mix.lock b/mix.lock
@@ -63,7 +63,7 @@
"jose": {:hex, :jose, "1.10.1", "16d8e460dae7203c6d1efa3f277e25b5af8b659febfc2f2eb4bacf87f128b80a", [:mix, :rebar3], [], "hexpm", "3c7ddc8a9394b92891db7c2771da94bf819834a1a4c92e30857b7d582e2f8257"},
"jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"},
"libring": {:hex, :libring, "1.4.0", "41246ba2f3fbc76b3971f6bce83119dfec1eee17e977a48d8a9cfaaf58c2a8d6", [:mix], [], "hexpm"},
- "linkify": {:hex, :linkify, "0.2.0", "2518bbbea21d2caa9d372424e1ad845b640c6630e2d016f1bd1f518f9ebcca28", [:mix], [], "hexpm", "b8ca8a68b79e30b7938d6c996085f3db14939f29538a59ca5101988bb7f917f6"},
+ "linkify": {:git, "https://hacktivis.me/git/auto_linker.git", "3249ae438fce64ee0e72d279bfa8f070a89f229c", [branch: "lanodan/master"]},
"makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"},
"makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"},
"meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm", "d34f013c156db51ad57cc556891b9720e6a1c1df5fe2e15af999c84d6cebeb1a"},
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs
@@ -154,7 +154,8 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
{:ok, user} =
UserBuilder.insert(%{nickname: "user__test", ap_id: "http://foo.com/user__test"})
- text = "**hello world**\n\n*another @user__test and @user__test google.com paragraph*"
+ text =
+ "**hello world**\n\n*another @user__test and @user__test http://google.com paragraph*"
{output, _, _} = Utils.format_input(text, "text/markdown")
@@ -163,7 +164,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
user.id
}" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a class="u-url mention" data-user="#{
user.id
- }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
+ }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">http://google.com</a> paragraph</em></p>)
end
end
diff --git a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
@@ -326,7 +326,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
test "update fields", %{conn: conn} do
fields = [
%{"name" => "<a href=\"http://google.com\">foo</a>", "value" => "<script>bar</script>"},
- %{"name" => "link.io", "value" => "cofe.io"}
+ %{"name" => "link.io", "value" => "http://cofe.io"}
]
account_data =
@@ -338,7 +338,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
%{"name" => "<a href=\"http://google.com\">foo</a>", "value" => "bar"},
%{
"name" => "link.io",
- "value" => ~S(<a href="http://cofe.io" rel="ugc">cofe.io</a>)
+ "value" => ~S(<a href="http://cofe.io" rel="ugc">http://cofe.io</a>)
}
]
@@ -347,7 +347,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
"name" => "<a href=\"http://google.com\">foo</a>",
"value" => "<script>bar</script>"
},
- %{"name" => "link.io", "value" => "cofe.io"}
+ %{"name" => "link.io", "value" => "http://cofe.io"}
]
end
@@ -446,7 +446,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
fields = [
%{"name" => "foo", "value" => "bar"},
- %{"name" => "link", "value" => "cofe.io"}
+ %{"name" => "link", "value" => "http://cofe.io"}
]
assert %{"error" => "Invalid request"} ==