diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-18 21:10:38 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-18 21:10:38 -0500 |
commit | d620d1749d93d60a52a3c52115bfe4f1abdfa791 (patch) | |
tree | 161daad0e0176cde203f8dae278ef8010419841a | |
parent | d219ecded618660b2230c1a5bc8ce8f64bc465c8 (diff) |
exclude mentions & hashtags from anchor tagging
-rw-r--r-- | app/lib/sanitize_config.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb index da38d70b7..882b59b79 100644 --- a/app/lib/sanitize_config.rb +++ b/app/lib/sanitize_config.rb @@ -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 |