diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-17 18:11:18 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-17 18:11:18 -0500 |
commit | 40d4eccb003e969c0249ba0797937772bbe0e8ef (patch) | |
tree | 7ecce6bb77c0b7d52094dea02a71b50a619032b0 /app/lib | |
parent | ddd84a97ad85ea13e9fcb1158a5cbb0db51cb42f (diff) |
allow escaping bangtags with `#!!`
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/bangtags.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index 8c4517acb..8fbac8564 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -38,10 +38,11 @@ class Bangtags def process return unless !@vars['_bangtags:disable'] && status.text&.present? && status.text.include?('#!') - status.text.gsub!('#!!', "#\u200c!") + status.text.gsub!('#!!', "#\uf666!") status.text.split(/(#!(?:.*:!#|{.*?}|[^\s#]+))/).each do |chunk| if @vore_stack.last == '_draft' || (@chunks.present? && @chunks.first.include?('#!draft')) + chunk.gsub("#\uf666!", '#!') @chunks << chunk elsif chunk.starts_with?("#!") chunk.sub!(/(\\:)?+:+?!#\Z/, '\1') @@ -540,6 +541,8 @@ class Bangtags end end + chunk.gsub!("#\uf666!", '#!') unless chunk.blank? + if chunk.present? && @tf_cmds.present? @tf_cmds.each do |tf_cmd| next if chunk.nil? || tf_cmd[0].nil? |