mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 14:18:35 +01:00
[html] clean data attributes (#3782)
Some feed readers had difficulties with attributes containing html tags
This commit is contained in:
parent
d4e4c3e89a
commit
cee25d862d
10
lib/html.php
10
lib/html.php
@ -269,7 +269,15 @@ function convertLazyLoading($dom)
|
||||
} else {
|
||||
continue; // Proceed to next element without removing attributes
|
||||
}
|
||||
// Remove attributes that may be processed by the client (data-* are not)
|
||||
|
||||
// Remove data attributes, no longer necessary
|
||||
foreach ($img->getAllAttributes() as $attr => $val) {
|
||||
if (str_starts_with($attr, 'data-')) {
|
||||
$img->removeAttribute($attr);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove other attributes that may be processed by the client
|
||||
foreach (['loading', 'decoding', 'srcset'] as $attr) {
|
||||
if ($img->hasAttribute($attr)) {
|
||||
$img->removeAttribute($attr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user