add `tf:stripachors` & `tf:striplinks` bangtags
parent
c4718cd2be
commit
70080ce6e6
|
@ -594,6 +594,11 @@ class Bangtags
|
||||||
tf_cmd[1..-1].in_groups_of(2) do |args|
|
tf_cmd[1..-1].in_groups_of(2) do |args|
|
||||||
chunk.gsub!(*args) if args.all?
|
chunk.gsub!(*args) if args.all?
|
||||||
end
|
end
|
||||||
|
when 'stripanchors'
|
||||||
|
chunk.gsub!(/<a .*?<\/a>/mi, '')
|
||||||
|
when 'striplinks'
|
||||||
|
chunk.gsub!(/\S+:\/\/[\w\-]+\.\S+/, '')
|
||||||
|
chunk = ActionController::Base.helpers.strip_links(chunk)
|
||||||
when 'head', 'take'
|
when 'head', 'take'
|
||||||
n = tf_cmd[1].to_i
|
n = tf_cmd[1].to_i
|
||||||
n = 1 unless n > 0
|
n = 1 unless n > 0
|
||||||
|
|
Loading…
Reference in New Issue