Update Post.php
This commit is contained in:
@@ -170,12 +170,19 @@ public function getHtmlBodyAttribute()
|
||||
$figureElement->appendChild($imgElement);
|
||||
$figureElement->setAttribute('class', 'image');
|
||||
|
||||
// Create a new <footer> element inside <figure>
|
||||
$footerElement = new \DOMElement('footer', $imgElement->getAttribute('alt'));
|
||||
// Create a new <footer> element inside <figure> without directly setting its content
|
||||
$footerElement = $imgElement->ownerDocument->createElement('footer');
|
||||
$figureElement->appendChild($footerElement);
|
||||
|
||||
// Add the content to <footer> using createTextNode to ensure special characters are handled
|
||||
$footerText = $imgElement->ownerDocument->createTextNode($imgElement->getAttribute('alt'));
|
||||
$footerElement->appendChild($footerText);
|
||||
|
||||
// Set the class attribute for <footer>
|
||||
$footerElement->setAttribute('class', 'image-caption');
|
||||
});
|
||||
|
||||
|
||||
// Add Bootstrap 5 styling to tables
|
||||
$crawler->filter('table')->each(function (Crawler $node) {
|
||||
$tableElement = $node->getNode(0);
|
||||
|
||||
Reference in New Issue
Block a user