From 70080ce6e647f41e71a9f260d1ea3b9b5cecdb6a Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 20 Jul 2019 22:42:23 -0500 Subject: add `tf:stripachors` & `tf:striplinks` bangtags --- app/lib/bangtags.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/lib') diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index f40ccede3..def4432d2 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -594,6 +594,11 @@ class Bangtags tf_cmd[1..-1].in_groups_of(2) do |args| chunk.gsub!(*args) if args.all? end + when 'stripanchors' + chunk.gsub!(//mi, '') + when 'striplinks' + chunk.gsub!(/\S+:\/\/[\w\-]+\.\S+/, '') + chunk = ActionController::Base.helpers.strip_links(chunk) when 'head', 'take' n = tf_cmd[1].to_i n = 1 unless n > 0 -- cgit