feat(join): highlight auto-linked join-form links
This commit is contained in:
parent
aced57d0fd
commit
ee5ccbf7e9
3 changed files with 9 additions and 7 deletions
|
|
@ -15,18 +15,18 @@ defmodule MvWeb.Helpers.JoinDescriptionRendererTest do
|
|||
end
|
||||
|
||||
describe "render/1" do
|
||||
test "converts a raw URL to an anchor tag" do
|
||||
test "converts a raw URL to an anchor tag with the standard link class" do
|
||||
result = html("Akzeptiere https://example.com/dsgvo")
|
||||
|
||||
assert result =~ ~s(<a href="https://example.com/dsgvo")
|
||||
assert result =~ ~s(<a href="https://example.com/dsgvo" class="link link-primary")
|
||||
assert result =~ "https://example.com/dsgvo</a>"
|
||||
assert result =~ "Akzeptiere "
|
||||
end
|
||||
|
||||
test "converts Markdown [text](url) to an anchor tag with the link text" do
|
||||
test "converts Markdown [text](url) to an anchor tag with the standard link class" do
|
||||
result = html("[Datenschutzerklärung](https://example.com/dsgvo)")
|
||||
|
||||
assert result =~ ~s(<a href="https://example.com/dsgvo")
|
||||
assert result =~ ~s(<a href="https://example.com/dsgvo" class="link link-primary")
|
||||
assert result =~ ">Datenschutzerklärung</a>"
|
||||
end
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ defmodule MvWeb.Helpers.JoinDescriptionRendererTest do
|
|||
url = "https://example.com/#{path}"
|
||||
result = html("[#{label}](#{url})")
|
||||
|
||||
assert result =~ ~s(<a href="#{url}">#{label}</a>)
|
||||
assert result =~ ~s(<a href="#{url}" class="link link-primary">#{label}</a>)
|
||||
assert result |> :binary.matches("<a ") |> length() == 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue