diff options
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 7f22c8244..a27994e94 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -206,3 +206,16 @@ function dowload_favicon ($website, $id) { return $favicon_url; } + +/** + * Add support of image lazy loading + * Move content from src attribute to data-original + * @param content is the text we want to parse + */ +function lazyimg($content) { + return preg_replace( + '/<img([^<]+)src=([\'"])([^"\']*)([\'"])([^<]*)>/i', + '<img$1src="' . Url::display('/data/grey.gif') . '" data-original="$3"$5>', + $content + ); +} |
