$nextSibling = $this->getNoneEmptyNode($link, 'nextSibling');
$previousSibling = $this->getNoneEmptyNode($link, 'previousSibling');
- //Check whether the link is at the beginning or end of the paragraph
- //and whether the next or previous sibling is a line break.
- //<p><a href="https://example.com">https://example.com</a><br>…</p>
- //<p>…<br><a href="https://example.com">https://example.com</a></p>
+ // Check whether the link is at the beginning or end of the paragraph
+ // and whether the next or previous sibling is a line break.
+ // <p><a href="https://example.com">https://example.com</a><br>…</p>
+ // <p>…<br><a href="https://example.com">https://example.com</a></p>
if (
($nextSibling === null && $previousSibling !== null && $previousSibling->nodeName === 'br')
|| ($previousSibling === null && $nextSibling !== null && $nextSibling->nodeName === 'br')
$this->plainLinks[] = $plainLink->setIsStandalone($parent, false);
continue;
}
- //If not, the previous and next sibling may be a line break.
- //<p>…<br><a href="https://example.com">https://example.com</a><br>…</p>
- //<p>…<br><u><b><a href="https://example.com">https://example.com</a></b></u><br>…</p>
+ // If not, the previous and next sibling may be a line break.
+ // <p>…<br><a href="https://example.com">https://example.com</a><br>…</p>
+ // <p>…<br><u><b><a href="https://example.com">https://example.com</a></b></u><br>…</p>
if (
$previousSibling === null && $nextSibling === null
|| (
$parent = $this->link;
$next = $this->findBr($this->link, 'nextSibling');
$previous = $this->findBr($this->link, 'previousSibling');
- //link inside other elements(u, i, b, …)
+ // Link inside other elements(u, i, b, …)
while ($next === null && $previous === null && $parent !== $this->topLevelParent) {
$parent = $parent->parentElement;
$next = $this->findBr($parent, 'nextSibling');
}
\assert($replaceNode instanceof \DOMElement);
- //remove <br> from start and end of the new block elements
+ // Remove <br> from start and end of the new block elements
if ($next !== null) {
DOMUtil::removeNode($next);
}