about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-19 16:00:55 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-19 16:00:55 -0600
commitf9837791a4b05dcb965a085a998c2f0b4aaa6e50 (patch)
tree860cd399000957891f0f741146cd1d87855b23d3 /app/lib
parent698588143bfb9aa0255bfb472dee4fb011c33646 (diff)
fix bangtag and screenreader escape tags (`#``!!`, `#``!nosr ... ``#``!sr`)
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/bangtags.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index d8e47cb8d..a48b87155 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -1193,8 +1193,6 @@ class Bangtags
         end
       end
 
-      chunk.gsub!("#\ufdd6!", '#!') unless chunk.blank? || chunk.frozen?
-
       if chunk.present? && @tf_cmds.present?
         @tf_cmds.each do |tf_cmd|
           next if chunk.nil? || tf_cmd[0].nil?
@@ -1313,6 +1311,8 @@ class Bangtags
     @user.save
 
     text = @chunks.join
+    text.gsub!("#\ufdd6!", '#!')
+    text.gsub!(/\ufdd3(.*)\ufdd4/m, '<span aria-hidden="true">\1</span>')
     text.gsub!(/\n\n+/, "\n") if @crunch_newlines
     text.strip!
     text = text.split("\n").map(&:strip).join("\n") if @strip_lines