Remove oembed for now, will submit it in another MR. Fix warnings
This commit is contained in:
parent
018516d3f3
commit
b5de7c4c4d
11 changed files with 22 additions and 164 deletions
|
|
@ -165,14 +165,16 @@ defmodule Pleroma.Formatter do
|
|||
end
|
||||
|
||||
def truncate(text, opts \\ []) do
|
||||
max_length = opts[:max_length] || 200
|
||||
omission = opts[:omission] || "..."
|
||||
max_length = opts[:max_length] || 200
|
||||
omission = opts[:omission] || "..."
|
||||
|
||||
cond do
|
||||
not String.valid?(text) ->
|
||||
text
|
||||
|
||||
String.length(text) < max_length ->
|
||||
text
|
||||
|
||||
true ->
|
||||
length_with_omission = max_length - String.length(omission)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue