From 998eefd4c5de1f125f12b11f2525257e0cf52a13 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 22 Jan 2024 18:14:35 +0100 Subject: [PATCH] Improve the docs --- .../lib/system/html/node/HtmlNodePlainLink.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/html/node/HtmlNodePlainLink.class.php b/wcfsetup/install/files/lib/system/html/node/HtmlNodePlainLink.class.php index 3d949e9d52..726c0dc675 100644 --- a/wcfsetup/install/files/lib/system/html/node/HtmlNodePlainLink.class.php +++ b/wcfsetup/install/files/lib/system/html/node/HtmlNodePlainLink.class.php @@ -186,8 +186,8 @@ class HtmlNodePlainLink $next = $this->findBr($this->link, 'nextSibling'); $previous = $this->findBr($this->link, 'previousSibling'); - // If multiple links are in the same paragraph, the `topLevelParent` link to old parent in the DOM - // and have to be found again. + // When multiple links are in the same paragraph, `topLevelParent` + // may no longer be a valid reference. if ($this->topLevelParent->parentElement === null) { $this->topLevelParent = $this->link; while ($this->topLevelParent->parentNode->nodeName !== 'body') { @@ -202,8 +202,8 @@ class HtmlNodePlainLink $previous = $this->findBr($parent, 'previousSibling'); } - // Link is the only content in the top level parent. - // This will happen, when in one paragraph are multiple links. + // The link is the only content in the top level parent. This + // can happen when there are multiple links within one paragraph. if ($next === null && $previous === null) { $this->topLevelParent->parentNode->insertBefore($this->link, $this->topLevelParent); DOMUtil::removeNode($this->topLevelParent); -- 2.20.1