0
0
Fork 0

Only URLs extract with pre-escaped text (#9991)

* [test] add japanese hashtag testcase

* Only URLs extract with pre-escaped text

( https://github.com/tootsuite/mastodon/issues/9989 )
This commit is contained in:
Hinaloe 2019-02-09 11:39:38 +09:00 committed by Eugen Rochko
parent d09ce6d81b
commit 157d3af46c
2 changed files with 9 additions and 1 deletions

View file

@ -210,7 +210,7 @@ class Formatter
# Note: I couldn't obtain list_slug with @user/list-name format
# for mention so this requires additional check
special = Extractor.extract_entities_with_indices(escaped, options).map do |extract|
special = Extractor.extract_urls_with_indices(escaped, options).map do |extract|
# exactly one of :url, :hashtag, :screen_name, :cashtag keys is present
key = (extract.keys & [:url, :hashtag, :screen_name, :cashtag]).first