From 90130014dd27a909fda8a63d3ce520d4d31fd68c Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 29 Jul 2019 23:09:51 -0500 Subject: add plain-text console formatting option --- app/lib/formatter.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/lib/formatter.rb') diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 524e09247..bbe123b54 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -229,6 +229,7 @@ class Formatter else html = simple_format(html, {}, sanitize: false) html = html.delete("\n") + html = format_console(html) if status.content_type == 'text/console' end unless status.footer.blank? @@ -247,13 +248,17 @@ class Formatter html.html_safe # rubocop:disable Rails/OutputSafety end + def format_console(html) + "
#{html}
" + end + def format_markdown(html) html = markdown_formatter.render(html) end def format_bbcode(html) html = bbcode_formatter(html) - html = html.gsub(/
.*<\/hr>/im, '
') + html.gsub(/
.*<\/hr>/im, '
') end def format_bbdown(html) -- cgit