From e6ce2885c0b4586a270e0ace79598a92365df56f Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 6 Feb 2024 21:23:51 +0100 Subject: Fix: Keep indentation in html and md code blocks. Moves the logic for unwrapping broken lines in html (and Markdown) to the node processing, instead of doing it over the full html content. This allows us to skip if for code blocks (aka `` elements within `
` elements).
---
 tests/unit/includes/MarkdownTest.php | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'tests/unit/includes/MarkdownTest.php')

diff --git a/tests/unit/includes/MarkdownTest.php b/tests/unit/includes/MarkdownTest.php
index 8025e8efa..c51fbfe16 100644
--- a/tests/unit/includes/MarkdownTest.php
+++ b/tests/unit/includes/MarkdownTest.php
@@ -77,6 +77,10 @@ class MarkdownTest extends UnitTestCase {
 				"[code]some code\nover multiple lines[/code]",
 				"```\nsome code\nover multiple lines\n```"
 			],
+			'code block no language indented' => [
+				"[code]some code\n    over multiple lines\n    with indentation[/code]",
+				"```\nsome code\n    over multiple lines\n    with indentation\n```"
+			],
 		];
 	}
 
-- 
cgit v1.2.3