Made raw images + internal/external links work right
authorDan
Wed, 11 Jul 2007 15:56:18 -0400
changeset 67 f6454d5fec7a
parent 66 52017732bc20
child 68 eb34257a6377
Made raw images + internal/external links work right
includes/render.php
includes/wikiengine/Render/Xhtml/Url.php
includes/wikiengine/Render/Xhtml/Wikilink.php
--- a/includes/render.php	Wed Jul 11 15:36:01 2007 -0400
+++ b/includes/render.php	Wed Jul 11 15:56:18 2007 -0400
@@ -858,7 +858,12 @@
       }
       else if ( $caption == '|raw' )
       {
-        $complete_tag .= $img_tag;
+        $complete_tag .= "$img_tag";
+        $taglist[$i] = $complete_tag;
+        
+        $repl = "{$s_delim}e_img_{$i}{$f_delim}";
+        $text = str_replace($full_tag, $repl, $text);
+        continue;
       }
       else
       {
--- a/includes/wikiengine/Render/Xhtml/Url.php	Wed Jul 11 15:36:01 2007 -0400
+++ b/includes/wikiengine/Render/Xhtml/Url.php	Wed Jul 11 15:56:18 2007 -0400
@@ -100,9 +100,15 @@
             }
 
             // generate a regular link (not an image)
-            $text = $this->textEncode($text);
+            // $text = $this->textEncode($text);
             $css = $this->formatConf(' class="%s"', "css_$type");
             $output = "<a$css href={$quote}$href{$quote}";
+            
+            // hackish fix for the "external" image in Oxygen [added for Enano]
+            if ( preg_match('/<(.+?)>/is', $text) )
+            {
+              $output .= ' style="background-image: none; padding-right: 0;"';
+            }
 
             if ($target) {
                 // use a "popup" window.  this is XHTML compliant, suggested by
--- a/includes/wikiengine/Render/Xhtml/Wikilink.php	Wed Jul 11 15:36:01 2007 -0400
+++ b/includes/wikiengine/Render/Xhtml/Wikilink.php	Wed Jul 11 15:56:18 2007 -0400
@@ -99,7 +99,17 @@
         // up what the user typed and what we're checking.
         //$page = $this->urlEncode($page);
         $anchor = $this->urlEncode($anchor);
-        $text = $this->textEncode($text);
+        // $text = $this->textEncode($text);
+        
+        // hackish fix for the "external" image in Oxygen [added for Enano]
+        if ( preg_match('/<(.+?)>/is', $text) )
+        {
+          $nobg = ' style="background-image: none; padding-right: 0;"';
+        }
+        else
+        {
+          $nobg = '';
+        }
         
         // does the page exist?
         if ($exists) {
@@ -123,7 +133,7 @@
             // get the CSS class and generate output
             $css = $this->formatConf(' class="%s"', 'css');
 
-            $start = '<a'.$css.' href="'.$href.$as.'">';
+            $start = '<a'.$css.' href="'.$href.$as.'"'.$nobg.'>';
             $end = '</a>';
         } else {
 
@@ -146,7 +156,7 @@
             // get the CSS class and generate output
             $css = $this->formatConf(' class="%s"', 'css');
 
-            $start = '<a'.$css.' href="'.$href.$as.'" class="wikilink-nonexistent">';
+            $start = '<a'.$css.' href="'.$href.$as.'"'.$nobg.' class="wikilink-nonexistent">';
             $end = '</a>';
             
         }