Skip to content

Commit 08cb7a1

Browse files
authored
Merge pull request #7 from Kdecherf/fix/srcset
Fix issue with non-integer x-descriptors in srcset
2 parents 7362c04 + 16da2b6 commit 08cb7a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

htmLawed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ function hl_tag($t){
519519
$v = str_replace("­", ' ', (strpos($v, '&') !== false ? str_replace(array('­', '­', '­'), ' ', $v) : $v)); # double-quoted char: soft-hyphen; appears here as "­" or hyphen or something else depending on viewing software
520520
if($k == 'srcset'){
521521
$v2 = '';
522-
$pattern = "/(?:[^\"'\s]+\s*(?:\d+[wx])+)/";
522+
$pattern = "/(?:[^\"'\s]+\s*(?:\d+w|\d+(?:\.\d+)?x)+)/";
523523
preg_match_all($pattern, $v, $matches);
524524
$matches = call_user_func_array('array_merge', $matches);
525525
foreach($matches as $k1=>$v1){

0 commit comments

Comments
 (0)