projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Salmon: generate private key with native crypto if available.
[akkoma]
/
lib
/
pleroma
/
formatter.ex
diff --git
a/lib/pleroma/formatter.ex
b/lib/pleroma/formatter.ex
index 27e2adc16b7298d0ed9d117a23abc0a4e2bd258d..fbcbca9796e7e6dba95b9b32b8dba5a94d204a78 100644
(file)
--- a/
lib/pleroma/formatter.ex
+++ b/
lib/pleroma/formatter.ex
@@
-7,9
+7,10
@@
defmodule Pleroma.Formatter do
end
@tag_regex ~r/\#\w+/u
end
@tag_regex ~r/\#\w+/u
- def parse_tags(text) do
+ def parse_tags(text
, data \\ %{}
) do
Regex.scan(@tag_regex, text)
|> Enum.map(fn (["#" <> tag = full_tag]) -> {full_tag, String.downcase(tag)} end)
Regex.scan(@tag_regex, text)
|> Enum.map(fn (["#" <> tag = full_tag]) -> {full_tag, String.downcase(tag)} end)
+ |> (fn map -> if data["sensitive"], do: [{"#nsfw", "nsfw"}] ++ map, else: map end).()
end
def parse_mentions(text) do
end
def parse_mentions(text) do