From 4e5cd0b1ed33344fd3b232caf065f8c68b0fd5c4 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 728400819c..dcaf34b915 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