diff options
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r-- | inc/parser/xhtml.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 184e62fe3..e3f9a4187 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -606,7 +606,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } //keep hash anchor - list($id,$hash) = explode('#',$id,2); + @list($id,$hash) = explode('#',$id,2); if(!empty($hash)) $hash = $this->_headerToLink($hash); //prepare for formating @@ -688,7 +688,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } /** - */ + */ function interwikilink($match, $name = null, $wikiName, $wikiUri) { global $conf; @@ -700,19 +700,28 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['name'] = $this->_getLinkTitle($name, $wikiUri, $isImage); //get interwiki URL - $url = $this->_resolveInterWiki($wikiName,$wikiUri); + $exists = null; + $url = $this->_resolveInterWiki($wikiName, $wikiUri, $exists); - if ( !$isImage ) { - $class = preg_replace('/[^_\-a-z0-9]+/i','_',$wikiName); + if(!$isImage) { + $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $wikiName); $link['class'] = "interwiki iw_$class"; } else { $link['class'] = 'media'; } //do we stay at the same server? Use local target - if( strpos($url,DOKU_URL) === 0 ){ + if(strpos($url, DOKU_URL) === 0 OR strpos($url, DOKU_BASE) === 0) { $link['target'] = $conf['target']['wiki']; } + if($exists !== null && !$isImage) { + if($exists) { + $link['class'] .= ' wikilink1'; + } else { + $link['class'] .= ' wikilink2'; + $link['rel'] = 'nofollow'; + } + } $link['url'] = $url; $link['title'] = htmlspecialchars($link['url']); |