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.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 662883416..169f4f9f4 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -1062,11 +1062,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['url'] = $url;
$link['title'] = htmlspecialchars($link['url']);
- //output formatted
+ // output formatted
if($returnonly) {
+ if($url == '') return $link['name'];
return $this->_formatLink($link);
} else {
- $this->doc .= $this->_formatLink($link);
+ if($url == '') $this->doc .= $link['name'];
+ else $this->doc .= $this->_formatLink($link);
}
}
@@ -1248,9 +1250,17 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
list($shortcut, $reference) = explode('>', $src, 2);
$exists = null;
$src = $this->_resolveInterWiki($shortcut, $reference, $exists);
+ if($src == '' && empty($title)){
+ // make sure at least something will be shown in this case
+ $title = $reference;
+ }
}
list($src, $hash) = explode('#', $src, 2);
$noLink = false;
+ if($src == '') {
+ // only output plaintext without link if there is no src
+ $noLink = true;
+ }
$render = ($linking == 'linkonly') ? false : true;
$link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
@@ -1637,7 +1647,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if(!$render) {
// if the picture is not supposed to be rendered
// return the title of the picture
- if(!$title) {
+ if($title === null || $title === "") {
// just show the sourcename
$title = $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($src)));
}