From b625487d2258a6f1f875813206adc9a5857dab24 Mon Sep 17 00:00:00 2001 From: andi Date: Fri, 15 Apr 2005 22:47:35 +0200 Subject: new parser: more hacking, RSS readded darcs-hash:20050415204735-9977f-613d9b007452d538dcb8fce4ade5cbec389c4415.gz --- inc/parser/handler.php | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'inc/parser/handler.php') diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 108a522a5..f36a4f151 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -357,12 +357,7 @@ class Doku_Handler { // If the title is an image, convert it to an array containing the image details } else if ( preg_match('/^\{\{[^\}]+\}\}$/',$link[1]) ) { - $media = Doku_Handler_Parse_Media($link[1]); - - // Check it's really an image, not a link to a file - if ( !strpos($media['type'], 'link') ) { - $link[1] = $media; - } + $link[1] = Doku_Handler_Parse_Media($link[1]); } //decide which kind of link it is @@ -421,18 +416,18 @@ class Doku_Handler { function media($match, $state, $pos) { $p = Doku_Handler_Parse_Media($match); - // If it's not an image, build a normal link - if ( strpos($p['type'], 'link') ) { - $this->__addCall($p['type'],array($p['src'], $p['title']), $pos); - } else { - $this->__addCall( - $p['type'], - array($p['src'], $p['title'], $p['align'], $p['width'], $p['height'], $p['cache']), - $pos - ); - } + $this->__addCall( + $p['type'], + array($p['src'], $p['title'], $p['align'], $p['width'], $p['height'], $p['cache']), + $pos + ); return TRUE; } + + function rss($match, $state, $pos) { + $link = preg_replace(array('/^\{\{rss>/','/\}\}$/'),'',$match); + $this->__addCall('rss',array($link),$pos); + } function externallink($match, $state, $pos) { // Prevent use of multibyte strings in URLs -- cgit v1.2.3