Skip to content

Commit 1879ec6

Browse files
author
Tony Kovanen
committed
Photon: Tweak data-recalc-dims regex.
The regex adding the data-recalc-dims should not care how many whitespace characers there are between the closing tag and the possible following link tag.
1 parent 3ceae94 commit 1879ec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

class.photon.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public static function filter_the_content( $content ) {
303303
$new_tag = preg_replace( '#(?<=\s)(width|height)=["|\']?[\d%]+["|\']?\s?#i', '', $new_tag );
304304

305305
// Tag an image for dimension checking
306-
$new_tag = preg_replace( '#(\s?/)?>(</a>)?$#i', ' data-recalc-dims="1"\1>\2', $new_tag );
306+
$new_tag = preg_replace( '#(\s?/)?>(\s*</a>)?$#i', ' data-recalc-dims="1"\1>\2', $new_tag );
307307

308308
// Replace original tag with modified version
309309
$content = str_replace( $tag, $new_tag, $content );

0 commit comments

Comments
 (0)