Skip to content

Commit

Permalink
Issue #6384: Make alignment of linked captioned images work regardles…
Browse files Browse the repository at this point in the history
…s of filter order.

By @indigoxela, @herbdool, and @olafgrabienski.
  • Loading branch information
indigoxela committed Mar 7, 2024
1 parent 5430d0a commit 7f93e61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/modules/filter/filter.module
Expand Up @@ -2670,6 +2670,11 @@ function _filter_image_align($text) {
if ($parent && $parent->nodeName === 'figure') {
$target = $parent;
}
// Consider more deeply nested structures. A link wrapped around a
// captioned image.
elseif ($parent && $parent->nodeName === 'a' && $parent->parentNode && $parent->parentNode->nodeName === 'figure') {
$target = $parent->parentNode;
}
else {
$target = $node;
}
Expand Down

0 comments on commit 7f93e61

Please sign in to comment.