From 36ebeeadb7230997d6f624e59e685b6ab82cd331 Mon Sep 17 00:00:00 2001 From: berliner Date: Thu, 24 Nov 2022 14:31:48 +0100 Subject: [PATCH] HPC-8778: Make sure there is a space before an inline caption --- .../ghi_content/modules/gho_footnotes/src/GhoFootnotes.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/modules/custom/ghi_content/modules/gho_footnotes/src/GhoFootnotes.php b/html/modules/custom/ghi_content/modules/gho_footnotes/src/GhoFootnotes.php index a2c264465..5f3a8dcb9 100644 --- a/html/modules/custom/ghi_content/modules/gho_footnotes/src/GhoFootnotes.php +++ b/html/modules/custom/ghi_content/modules/gho_footnotes/src/GhoFootnotes.php @@ -52,7 +52,10 @@ public static function updateFootnotes($html, $build) { // Update the footnote references and remove the containing div. $node_inner_html = gho_footnotes_update_text($id, $node_inner_html, $references, $footnotes); $fragment = $dom->createDocumentFragment(); - $fragment->appendXml($node_inner_html); + // Note that we add a newline here. This is made to prevent a strange + // issue with the caption credits, that are sometimes appearing spaceless + // after the last paragraph of a text. + $fragment->appendXml($node_inner_html . "\n"); $node->parentNode->replaceChild($fragment, $node); }