Exclude tags with more than 40 characters from being extracted.

They are still in the HTML produced

Closes #562

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-04-21 14:54:39 +02:00
parent 95062df343
commit ca860273a0
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 9 additions and 1 deletions

View File

@ -267,7 +267,15 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Events do
Map.merge(args, %{
description: description,
mentions: mentions,
tags: tags
# Exclude tags with length > 40
tags:
Enum.filter(tags, fn tag ->
case tag do
# For some reason transmogrifier gives us this
%{title: tag} -> String.length(tag) < 40
tag -> String.length(tag) < 40
end
end)
})
else
args