From fe65c0e44f4f8b05ce545eca8a429c1da162fc5a Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 24 May 2022 10:24:59 +0200 Subject: [PATCH] Fix leading spaces being stripped in Markdown code blocks Fixes #1776 --- app/lib/advanced_text_formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/advanced_text_formatter.rb b/app/lib/advanced_text_formatter.rb index 728400819..dcaf34b91 100644 --- a/app/lib/advanced_text_formatter.rb +++ b/app/lib/advanced_text_formatter.rb @@ -8,7 +8,7 @@ class AdvancedTextFormatter < TextFormatter end def block_code(code, _language) - <<~HTML.squish + <<~HTML
#{ERB::Util.h(code).gsub("\n", '
')}
HTML end