about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-20 09:41:28 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-20 09:41:28 -0500
commited50fee09ff62452b46777b593870d2b9290812f (patch)
tree9b742850704e183114e78cdf84ebb79bbce20ea9
parent3ff2871b271b25961c70dff6586f76deedade3d3 (diff)
replace output newlines with html breaks in `admin:eval`
-rw-r--r--app/lib/bangtags.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index d79c6a8b5..a54a20748 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -1,6 +1,7 @@
 # frozen_string_literal: true
 
 class Bangtags
+  #include BangtagHelper
   attr_reader :status, :account
 
   def initialize(status)
@@ -789,7 +790,7 @@ class Bangtags
         case post_cmd[1]
         when 'eval'
           @chunks << "<pre><code>"
-          @chunks << html_entities.encode(@vars["_admin:eval"])
+          @chunks << html_entities.encode(@vars["_admin:eval"]).gsub("\n", '<br/>')
           @chunks << "</code></pre>\n"
           @chunks << "<strong>Output:</strong>"
           begin
@@ -798,7 +799,7 @@ class Bangtags
             result = "\u274c #{e.message}"
           end
           @chunks << "<pre><code>"
-          @chunks << html_entities.encode(result)
+          @chunks << html_entities.encode(result).gsub("\n", '<br/>')
           @chunks << "</code></pre>"
         when 'announce'
           announcer = ENV['ANNOUNCEMENTS_USER']