Skip to content

Commit

Permalink
Correct class matching for Parsoid
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 authored May 31, 2024
1 parent 93686a1 commit 2dc6bdd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,8 @@

# Eager load image with image has the class 'sct-thumb-nolazyload'
$wgHooks['ThumbnailBeforeProduceHTML'][] = function ( ThumbnailImage $thumbnail, array &$attribs, array &$linkAttribs ) {
$class = $attribs['class'] ?? '';
# Classes in the wikitext image syntax are applied to linkAttribs
$class = $linkAttribs['class'] ?? '';
if ( strpos( $class, 'mw-image-nolazyload' ) !== false ) {
$attribs['loading'] = 'eager';
}
Expand Down

0 comments on commit 2dc6bdd

Please sign in to comment.