exclude mentions & hashtags from anchor tagging

staging
multiple creatures 2019-07-18 21:10:38 -05:00
parent d219ecded6
commit d620d1749d
1 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,9 @@ class Sanitize
node = env[:node]
return if node['href'].blank? || node.text.blank?
class_list = node['class']&.split(/[\t\n\f\r ]/)
return if class_list && class_list.include?('mention') || class_list.include?('hashtag')
# href matches link text verbatim?
href = node['href']
return if href == node.text.strip