about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-10-10 21:02:15 -0500
committermultiple creatures <dev@multiple-creature.party>2019-10-10 21:02:15 -0500
commit81988e386d36894b2389afb94e3bfcb8c5ffaa5a (patch)
treee98d671991598889d9eadb9eddea3d95d704cf65
parent8a8e74fc2b45bff79d5d96207bc0ab8a9f30c47e (diff)
stopped using private-use codepoints as formatting placeholders (resolves #9)
-rw-r--r--app/lib/bangtags.rb12
-rw-r--r--app/lib/formatter.rb6
-rw-r--r--app/services/post_status_service.rb8
3 files changed, 13 insertions, 13 deletions
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, '<span aria-hidden="true">\1</span>')
+    html.gsub(/\ufdd3(.*)\ufdd4/m, '<span aria-hidden="true">\1</span>')
   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
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 95333585f..e7c81309f 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -135,14 +135,14 @@ class PostStatusService < BaseService
   def extract_tags
     return unless '#'.in?(@text)
     @text = @text.dup if @text.frozen?
-    @text.gsub!(/^##/, "\uf666")
-    @text.gsub!('##', "\uf669")
+    @text.gsub!(/^##/, "\ufdd6")
+    @text.gsub!('##', "\ufdd9")
     @tags |= Extractor.extract_hashtags(@text)
     @text.strip!
     @text.gsub!(/^(?:#[\w:._·\-]+\s*)+$/, '')
     @text.strip!
-    @text.gsub!("\uf669", "##")
-    @text.gsub!("\uf666", "#")
+    @text.gsub!("\ufdd9", "##")
+    @text.gsub!("\ufdd6", "#")
   end
 
   def preprocess_attributes!