diff --git a/inc/namespace.php b/inc/namespace.php index 9a58c0a..7b33991 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -74,7 +74,7 @@ function enable_lightbox_for_images( string $content ): string { $libxml_use_internal_errors = libxml_use_internal_errors( true ); $document_loaded = $document->loadHTML( sprintf( - '%s', + '%s', $content ), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD @@ -144,8 +144,18 @@ function enable_lightbox_for_images( string $content ): string { $link->setAttribute( 'data-group', $image_id ); } - // Strip the XML tag as it's only used for the internal encoding. - $document_html = trim( str_replace( '', '', (string) $document->saveHTML() ) ); + // Strip the XML tag and placeholders as it's only used for the internal encoding. + $document_html = trim( + str_replace( + [ + '', + '', + '', + ], + '', + (string) $document->saveHTML() + ) + ); if ( $document_html ) { $content = $document_html; }