fix(deps): replace earmark with mdex
This commit is contained in:
parent
a96fb31a89
commit
9154f6fe3c
5 changed files with 55 additions and 7 deletions
|
|
@ -220,6 +220,15 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
|
|||
assert result == ~s[<a href="http://example.org/">OwO</a>]
|
||||
end
|
||||
|
||||
test "markdown links do not allow injected attributes" do
|
||||
code = ~s|[click](http://example.com/?a=x" onerror="alert(1))|
|
||||
{result, [], []} = Utils.format_input(code, "text/markdown")
|
||||
|
||||
assert result =~ ~s(<a href="http://example.com/?a=x">)
|
||||
refute result =~ ~s|onerror="alert(1)|
|
||||
refute result =~ ~s(<a href="http://example.com/?a=x" onerror=)
|
||||
end
|
||||
|
||||
test "rulers" do
|
||||
code = ~s[before\n\n-----\n\nafter]
|
||||
{result, [], []} = Utils.format_input(code, "text/markdown")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue