Truncate the length of Rich Media title and description fields
Some sites like Instagram are serving obnoxiously long metadata fields
This commit is contained in:
parent
6e1223a1ed
commit
7763b9a87f
5 changed files with 118 additions and 1 deletions
|
|
@ -61,6 +61,13 @@ defmodule Pleroma.Web.RichMedia.ParserTest do
|
|||
}}
|
||||
end
|
||||
|
||||
test "truncates title and description fields" do
|
||||
{:ok, parsed} = Parser.parse("https://instagram.com/longtext")
|
||||
|
||||
assert String.length(parsed["title"]) == 120
|
||||
assert String.length(parsed["description"]) == 200
|
||||
end
|
||||
|
||||
test "parses OEmbed and filters HTML tags" do
|
||||
assert Parser.parse("https://example.com/oembed") ==
|
||||
{:ok,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue