1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-05 08:07:33 +02:00

[Core] Add html/convertLazyLoading (+ document stripRecursiveHTMLSection) (#3157)

* [core] Add html/convertLazyLoading($dom)

Looks for lazy-loading attributes such as 'data-src' and converts
them back to regular ones such as 'src', easier for RSS readers.
It also converts <picture> elements to plain <img> elements.

* [core] Document html/stripRecursiveHTMLSection()

Add documentation for that function (no code changes).

* [WordPressBridge] Use convertLazyLoading()

* [WordPressBridge] Unwrap image figures

<img> inside <figure> may not display on RSS readers.
This converts them back to <img>, without losing caption if present.

* [ZDNet] Convert lazy loading images

* [code] html/stripRecursiveHTMLSection: Fix typo
This commit is contained in:
ORelio
2022-11-20 12:41:59 +01:00
committed by GitHub
parent 2f7f13d9fe
commit d592e2cb15
3 changed files with 91 additions and 15 deletions

View File

@@ -208,7 +208,7 @@ class ZDNetBridge extends FeedExpander
$contents = stripWithDelimiters($contents, '<meta itemprop="image"', '>');
$contents = stripWithDelimiters($contents, '<svg class="svg-symbol', '</svg>');
$contents = trim(stripWithDelimiters($contents, '<section class="sharethrough-top', '</section>'));
$item['content'] = $contents;
$item['content'] = convertLazyLoading($contents);
return $item;
}