From 81988e386d36894b2389afb94e3bfcb8c5ffaa5a Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Thu, 10 Oct 2019 21:02:15 -0500 Subject: stopped using private-use codepoints as formatting placeholders (resolves #9) --- app/lib/bangtags.rb | 12 ++++++------ app/lib/formatter.rb | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'app/lib') diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index d7df9c6c9..a16d6ca6e 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -72,11 +72,11 @@ class Bangtags def process return unless !@vars['_bangtags:disable'] && status.text&.present? && status.text.include?('#!') - status.text.gsub!('#!!', "#\uf666!") + status.text.gsub!('#!!', "#\ufdd6!") status.text.split(/(#!(?:.*:!#|{.*?}|[^\s#]+))/).each do |chunk| if @vore_stack.last == '_draft' || (@chunks.present? && @chunks.first.include?('#!draft')) - chunk.gsub("#\uf666!", '#!') + chunk.gsub("#\ufdd6!", '#!') @chunks << chunk elsif chunk.starts_with?("#!") chunk.sub!(/(\\:)?+:+?!#\Z/, '\1') @@ -695,11 +695,11 @@ class Bangtags when 'nosr', 'sroff', 'srskip' next if @sroff_open @sroff_open = true - chunk = "\uf333" + chunk = "\ufdd3" when 'sr', 'sron', 'srcont' next unless @sroff_open @sroff_open = false - chunk = "\uf334" + chunk = "\ufdd4" when 'histogram' @status.content_type = 'text/html' barchars = " #{(0x2588..0x258F).to_a.reverse.pack('U*')}" @@ -841,7 +841,7 @@ class Bangtags end end - chunk.gsub!("#\uf666!", '#!') unless chunk.blank? || chunk.frozen? + chunk.gsub!("#\ufdd6!", '#!') unless chunk.blank? || chunk.frozen? if chunk.present? && @tf_cmds.present? @tf_cmds.each do |tf_cmd| @@ -1032,7 +1032,7 @@ class Bangtags end end - @chunks << "\uf334" if @sroff_open + @chunks << "\ufdd4" if @sroff_open end def postprocess_after_save diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index b405a4e08..e21ff07d0 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -257,7 +257,7 @@ class Formatter end def format_screenreader(html) - html.gsub(/\uf333(.*)\uf334/m, '') + html.gsub(/\ufdd3(.*)\ufdd4/m, '') end def format_console(html) @@ -372,9 +372,9 @@ class Formatter def bbcode_formatter(html) begin - html.gsub!(/\[(?=[^\w\/])/, "\uf666") + html.gsub!(/\[(?=[^\w\/])/, "\ufdd6") html = html.bbcode_to_html(false, BBCODE_TAGS, :enable, *BBCODE_TAGS.keys) - html.gsub!("\uf666", '[') + html.gsub!("\ufdd6", '[') rescue Exception => e end html -- cgit