forked from potsda.mn/mobilizon
fix: allow html_to_text to receive nil, e.g. for empty event descriptions
Fixes potsda.mn/mobilizon#34
This commit is contained in:
parent
9c60c6d1ad
commit
63129b0769
|
@ -42,6 +42,7 @@ defmodule Mobilizon.Service.Formatter.HTML do
|
|||
def strip_tags_and_insert_spaces(html), do: html
|
||||
|
||||
@spec html_to_text(String.t()) :: String.t()
|
||||
def html_to_text(nil), do: nil
|
||||
def html_to_text(html) do
|
||||
html
|
||||
|> String.replace(~r/<li>/, "\\g{1}- ", global: true)
|
||||
|
|
Loading…
Reference in a new issue