document <protect> </protect> tags
[diogenes.git] / plugins / TextileMarkup.php
index e692a1b..7b032e6 100644 (file)
@@ -20,6 +20,7 @@
 
 require_once 'Plugin/Skel/Filter.php';
 require_once 'classTextile.php';
+require_once 'diogenes.text.inc.php';
 
 /** The TextileMarkup plugin allows you to render Textile markup into XHTML.
  */
@@ -29,7 +30,7 @@ class TextileMarkup extends Diogenes_Plugin_Skel_Filter
   var $name = "TextileMarkup";
   
   /** Plugin description */
-  var $description = "This plugin allows you to render Textile markup into XHTML. To get started, take a look at some <a href=\"http://www.textism.com/tools/textile/\">sample Textile markup pages</a>.";
+  var $description = "This plugin allows you to render Textile markup into XHTML. To get started, take a look at some <a href=\"http://www.textism.com/tools/textile/\">sample Textile markup pages</a>. You can protect HTML code from this plugin by enclosing it between &lt;protect&gt; and &lt;/protect&gt; tags.";
   
   
   /** Is the plugin allowed with respect to a given write permission on a page ?
@@ -49,7 +50,9 @@ class TextileMarkup extends Diogenes_Plugin_Skel_Filter
   function filter($input)
   {
     $textile = new Textile();
-    return $textile->TextileThis($input);
+    $data = htmlProtectFromTextism($input);
+    $data = $textile->TextileThis($data);
+    return htmlUnprotectFromTextism($data);
   }
   
 }