}
if ($containsElements) {
+ // Check if the *entire* content is striked through and wrap it.
+ $isStrikedThrough = false;
+ $strikethroughs = $htmlNodeProcessor->getXPath()->query("./s", $element);
+ if ($strikethroughs->length === 1 && $strikethroughs->item(0)->textContent === $element->textContent) {
+ $isStrikedThrough = true;
+ }
+
$newElement = $element->ownerDocument->createElement('kbd');
$newElement->appendChild(
$element->ownerDocument->createTextNode(
);
DOMUtil::replaceElement($element, $newElement, false);
+
+ if ($isStrikedThrough) {
+ $strikethrough = $newElement->ownerDocument->createElement("s");
+ $newElement->parentNode->insertBefore($strikethrough, $newElement);
+ $strikethrough->append($newElement);
+ }
}
}
}