Strip hashtag prefixes
Users may actually type in a literal hashtag into the search, so this will ensure it still returns results.
This commit is contained in:
parent
97e668f4aa
commit
19f32f7b09
2 changed files with 22 additions and 0 deletions
|
|
@ -141,6 +141,8 @@ defmodule Pleroma.Hashtag do
|
|||
|> String.trim()
|
||||
|> String.split(~r/\s+/)
|
||||
|> Enum.filter(&(&1 != ""))
|
||||
|> Enum.map(&String.trim_leading(&1, "#"))
|
||||
|> Enum.filter(&(&1 != ""))
|
||||
|
||||
if Enum.empty?(search_terms) do
|
||||
[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue