logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 0087d09b6b5073f813755865031892414d9e1bdc
parent: cdf47505bcc25ee5474305f012ec2ae1bf667b12
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri,  1 Mar 2019 23:26:36 +0100

mix.deps: Change auto_linker to my branch

Diffstat:

Mlib/pleroma/formatter.ex3++-
Mlib/pleroma/web/rich_media/helpers.ex2+-
Mmix.exs4+---
Mmix.lock2+-
Mtest/web/common_api/common_api_utils_test.exs5+++--
Mtest/web/mastodon_api/controllers/account_controller/update_credentials_test.exs20+++++++++++++-------
6 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex @@ -14,7 +14,8 @@ defmodule Pleroma.Formatter do hashtag_handler: &Pleroma.Formatter.hashtag_handler/4, mention: true, mention_handler: &Pleroma.Formatter.mention_handler/4, - scheme: true + phone: false, + extra_prefixes: Pleroma.Config.get([:uri_schemes, :valid_schemes]) def escape_mention_handler("@" <> nickname = mention, buffer, _, _) do case User.get_cached_by_nickname(nickname) do 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 = Application.get_env(:auto_linker, :opts)[:validate_tld] page_url - |> AutoLinker.Parser.url?(scheme: true, validate_tld: validate_tld) + |> AutoLinker.Parser.is_url?(scheme: true, validate_tld: validate_tld) |> parse_uri(page_url) end diff --git a/mix.exs b/mix.exs @@ -144,9 +144,7 @@ defmodule Pleroma.Mixfile do {:ex_syslogger, github: "slashmili/ex_syslogger", tag: "1.4.0"}, {:timex, "~> 3.5"}, {:ueberauth, "~> 0.4"}, - {:auto_linker, - git: "https://git.pleroma.social/pleroma/auto_linker.git", - ref: "95e8188490e97505c56636c1379ffdf036c1fdde"}, + {:auto_linker, git: "https://hacktivis.me/git/auto_linker.git", branch: "lanodan/master"}, {:http_signatures, git: "https://git.pleroma.social/pleroma/http_signatures.git", ref: "293d77bb6f4a67ac8bde1428735c3b42f22cbb30"}, diff --git a/mix.lock b/mix.lock @@ -1,6 +1,6 @@ %{ "accept": {:hex, :accept, "0.3.5", "b33b127abca7cc948bbe6caa4c263369abf1347cfa9d8e699c6d214660f10cd1", [:rebar3], [], "hexpm"}, - "auto_linker": {:git, "https://git.pleroma.social/pleroma/auto_linker.git", "95e8188490e97505c56636c1379ffdf036c1fdde", [ref: "95e8188490e97505c56636c1379ffdf036c1fdde"]}, + "auto_linker": {:git, "https://hacktivis.me/git/auto_linker.git", "71425bb5a4c0d8755b00a469763b75db8ce77899", [branch: "lanodan/master"]}, "base62": {:hex, :base62, "1.2.1", "4866763e08555a7b3917064e9eef9194c41667276c51b59de2bc42c6ea65f806", [:mix], [{:custom_base, "~> 0.2.1", [hex: :custom_base, repo: "hexpm", optional: false]}], "hexpm"}, "base64url": {:hex, :base64url, "0.0.1", "36a90125f5948e3afd7be97662a1504b934dd5dac78451ca6e9abf85a10286be", [:rebar], [], "hexpm"}, "bbcode": {:hex, :bbcode, "0.1.1", "0023e2c7814119b2e620b7add67182e3f6019f92bfec9a22da7e99821aceba70", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs @@ -154,14 +154,15 @@ 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*" expected = ~s(<p><strong>hello world</strong></p>\n<p><em>another <span class="h-card"><a data-user="#{ user.id }" class="u-url mention" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a data-user="#{ user.id - }" class="u-url mention" 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>\n) + }" class="u-url mention" 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>\n) {output, _, _} = Utils.format_input(text, "text/markdown") 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 @@ -260,7 +260,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", "value" => "cofe.io"} + %{"name" => "link", "value" => "http://cofe.io"} ] account_data = @@ -270,7 +270,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do assert account_data["fields"] == [ %{"name" => "<a href=\"http://google.com\">foo</a>", "value" => "bar"}, - %{"name" => "link", "value" => ~S(<a href="http://cofe.io" rel="ugc">cofe.io</a>)} + %{ + "name" => "link", + "value" => ~S(<a href="http://cofe.io" rel="ugc">http://cofe.io</a>) + } ] assert account_data["source"]["fields"] == [ @@ -278,13 +281,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do "name" => "<a href=\"http://google.com\">foo</a>", "value" => "<script>bar</script>" }, - %{"name" => "link", "value" => "cofe.io"} + %{"name" => "link", "value" => "http://cofe.io"} ] fields = [ "fields_attributes[1][name]=link", - "fields_attributes[1][value]=cofe.io", + "fields_attributes[1][value]=http://cofe.io", "fields_attributes[0][name]=<a href=\"http://google.com\">foo</a>", "fields_attributes[0][value]=bar" ] @@ -298,7 +301,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do assert account["fields"] == [ %{"name" => "<a href=\"http://google.com\">foo</a>", "value" => "bar"}, - %{"name" => "link", "value" => ~S(<a href="http://cofe.io" rel="ugc">cofe.io</a>)} + %{ + "name" => "link", + "value" => ~S(<a href="http://cofe.io" rel="ugc">http://cofe.io</a>) + } ] assert account["source"]["fields"] == [ @@ -306,7 +312,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do "name" => "<a href=\"http://google.com\">foo</a>", "value" => "bar" }, - %{"name" => "link", "value" => "cofe.io"} + %{"name" => "link", "value" => "http://cofe.io"} ] name_limit = Pleroma.Config.get([:instance, :account_field_name_length]) @@ -334,7 +340,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do fields = [ %{"name" => "<b>foo<b>", "value" => "<i>bar</i>"}, - %{"name" => "link", "value" => "cofe.io"} + %{"name" => "link", "value" => "http://cofe.io"} ] assert %{"error" => "Invalid request"} ==