From 1cf4d5a83dcc9a1b3d1bb556b40acf2828ee1241 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 20 Jul 2019 23:25:40 -0500 Subject: [PATCH] make anchor tagger strip trailing punctuation from link text before matching --- app/lib/sanitize_config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb index 697d88fd3..e7b70f078 100644 --- a/app/lib/sanitize_config.rb +++ b/app/lib/sanitize_config.rb @@ -74,8 +74,8 @@ class Sanitize return end - # strip trailing slashes - text.sub!(/\/+\Z/, '') + # strip trailing punctuation + text.sub!(/\p{Punct}+\Z/, '') # href starts with link text? return if href.start_with?(text)