aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/parser/xhtml.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r--inc/parser/xhtml.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index f40b1c4b7..417b143c6 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -1249,7 +1249,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$title = $reference;
}
}
- list($src, $hash) = explode('#', $src, 2);
+ // Squelch the warning in case there is no hash in the URL
+ @list($src, $hash) = explode('#', $src, 2);
$noLink = false;
if($src == '') {
// only output plaintext without link if there is no src
@@ -1657,6 +1658,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
)
) . '"';
$ret .= ' class="media'.$align.'"';
+ $ret .= ' loading="lazy"';
if($title) {
$ret .= ' title="'.$title.'"';
@@ -1886,7 +1888,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$url = ml($file, '', true, '&');
$linkType = 'internalmedia';
}
- $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($file)));
+ $title = !empty($atts['title'])
+ ? $atts['title']
+ : $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($file)));
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
// alternative content (just a link to the file)