From fda14ffc7c57c4451df9196e8125cd39b1d5c134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Izidor=20Matu=C5=A1ov?= Date: Thu, 7 Apr 2011 19:44:54 +0200 Subject: Check if link exists and set right caption --- inc/parser/xhtml.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 9405d9420..ab295dd01 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -574,11 +574,20 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $params = $parts[1]; } + // For empty $id we need to know the current $ID + // We need this check because _simpleTitle needs + // correct $id and resolve_pageid() use cleanID($id) + // (some things could be lost) + if ($id === '') { + $id = $ID; + } + // default name is based on $id as given $default = $this->_simpleTitle($id); // now first resolve and clean up the $id resolve_pageid(getNS($ID),$id,$exists); + $name = $this->_getLinkTitle($name, $default, $isImage, $id, $linktype); if ( !$isImage ) { if ( $exists ) { -- cgit v1.2.3