diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-16 21:52:10 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-16 21:52:10 +0100 |
commit | 02fdb912950b25bafecfc3f3f4d2b4be5352453b (patch) | |
tree | f1c67d720c96065ec343492dd6b301ba0060869a /inc/parser/xhtml.php | |
parent | e9ac0877f6c7eb3536f8f2b6b2a431c00de8fe4f (diff) | |
parent | 4d5fc927eace8f4208895cd309d23fc9025dbb6b (diff) | |
download | rpg-02fdb912950b25bafecfc3f3f4d2b4be5352453b.tar.gz rpg-02fdb912950b25bafecfc3f3f4d2b4be5352453b.tar.bz2 |
Merge pull request #527 from splitbrain/userlink
Linked and formatted user names
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r-- | inc/parser/xhtml.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 4966f103a..e3f9a4187 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -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']); |