FIX: Improve anchor links (#12683)

* FIX: Use theme color for anchor icon

* FIX: Do not count anchor links

* FIX: Do not count hashtags links either

* DEV: Add tests for link_count

* FIX: Disable anchors in quotes and preview

* FIX: Try building some anchor slugs for unicode

* DEV: Fix tests
This commit is contained in:
Bianca Nenciu
2021-04-14 10:27:07 +03:00
committed by GitHub
parent eeaecd4fd2
commit e4e2c7c66f
8 changed files with 69 additions and 11 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ module PrettyText
[category.url, text]
elsif (!is_tag && tag = Tag.find_by(name: text)) ||
(is_tag && tag = Tag.find_by(name: text.gsub!(TAG_HASHTAG_POSTFIX, '')))
["#{Discourse.base_url}/tag/#{tag.name}", text]
[tag.url, text]
else
nil
end