Fix OEmbed preview parser

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-10-20 09:36:26 +02:00
parent efd95044c2
commit 2ad043a91d
3 changed files with 14 additions and 8 deletions

View File

@@ -189,8 +189,11 @@ defmodule Mobilizon.Service.RichMedia.Parser do
defp maybe_parse(html) do
Enum.reduce_while(parsers(), %{}, fn parser, acc ->
case parser.parse(html, acc) do
{:ok, data} -> {:halt, data}
{:error, _msg} -> {:cont, acc}
{:ok, data} ->
{:halt, data}
{:error, _msg} ->
{:cont, acc}
end
end)
end