diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-01-29 11:13:34 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-01-29 11:13:34 +0300 |
commit | 1f4fbe9d98b7daef7eef2ffffbaca00e1d20c52b (patch) | |
tree | 1f0f79d116b67d832231d74c367ecfe3f688e334 /test/web/rich_media/parsers | |
parent | f1d5c0f07963c23d264311985c21837b9b03fd5a (diff) | |
download | pleroma-1f4fbe9d98b7daef7eef2ffffbaca00e1d20c52b.tar.gz |
title parse improvement
Diffstat (limited to 'test/web/rich_media/parsers')
-rw-r--r-- | test/web/rich_media/parsers/twitter_card_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/rich_media/parsers/twitter_card_test.exs b/test/web/rich_media/parsers/twitter_card_test.exs index e2610f4c2..751ca614c 100644 --- a/test/web/rich_media/parsers/twitter_card_test.exs +++ b/test/web/rich_media/parsers/twitter_card_test.exs @@ -85,4 +85,19 @@ defmodule Pleroma.Web.RichMedia.Parsers.TwitterCardTest do image: image_path }} end + + test "takes first founded title in html head if there is html markup error" do + html = File.read!("test/fixtures/nypd-facial-recognition-children-teenagers4.html") + + assert TwitterCard.parse(html, %{}) == + {:ok, + %{ + site: nil, + title: + "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database. - The New York Times", + "app:id:googleplay": "com.nytimes.android", + "app:name:googleplay": "NYTimes", + "app:url:googleplay": "nytimes://reader/id/100000006583622" + }} + end end |