From d25733fce1dfb70752b0c354985c0e07486064e6 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 13 Jun 2018 12:23:46 +0200 Subject: [PATCH] Converting multiple code blocks let to discarded newlines The XPath expression matched the global scope, eventually removing the newlines inside previously converted code blocks. --- .../html/metacode/converter/CodeMetacodeConverter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php b/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php index 0266ecb60c..bfd3204e7d 100644 --- a/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php +++ b/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php @@ -75,7 +75,7 @@ class CodeMetacodeConverter extends AbstractMetacodeConverter { $xpath = new \DOMXPath($element->ownerDocument); $replaceNodes = []; /** @var \DOMText $textNode */ - foreach ($xpath->query('//text()', $element) as $textNode) { + foreach ($xpath->query('.//text()', $element) as $textNode) { if (mb_strpos($textNode->textContent, "\n") !== false) { $replaceNodes[] = $textNode; } -- 2.20.1