From ed50fee09ff62452b46777b593870d2b9290812f Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 20 Jul 2019 09:41:28 -0500 Subject: replace output newlines with html breaks in `admin:eval` --- app/lib/bangtags.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/lib') 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 << "
"
-          @chunks << html_entities.encode(@vars["_admin:eval"])
+          @chunks << html_entities.encode(@vars["_admin:eval"]).gsub("\n", '
') @chunks << "
\n" @chunks << "Output:" begin @@ -798,7 +799,7 @@ class Bangtags result = "\u274c #{e.message}" end @chunks << "
"
-          @chunks << html_entities.encode(result)
+          @chunks << html_entities.encode(result).gsub("\n", '
') @chunks << "
" when 'announce' announcer = ENV['ANNOUNCEMENTS_USER'] -- cgit