fix Textile protection / unprotection
authorJeremy Laine <jeremy.laine@m4x.org>
Fri, 7 Jul 2006 11:58:20 +0000 (11:58 +0000)
committerJeremy Laine <jeremy.laine@m4x.org>
Fri, 7 Jul 2006 11:58:20 +0000 (11:58 +0000)
include/diogenes.text.inc.php
plugins/TextileMarkup.php

index 7f415d6..76ef7d9 100644 (file)
@@ -78,7 +78,7 @@ function textUnprotectTags($prot_open, $prot_close, $input)
  */
 function htmlProtectFromTextism($input)
 {
-  return textProtectTag("<table\s*?[^>]*>", "<\/table>", "{NOP:", ":NOP}", $input);
+  return textProtectTag("<protect>", "<\/protect>", "{NOP:", ":NOP}", $input);
 }
 
 
@@ -86,7 +86,9 @@ function htmlProtectFromTextism($input)
  */
 function htmlUnprotectFromTextism($input)
 {
-  return textUnprotectTags("{NOP:", ":NOP}", $input);
+  $input = textUnprotectTags("<p>\s*{NOP:", ":NOP}\s*<\/p>", $input);
+  $input = textUnprotectTags("{NOP:", ":NOP}", $input);
+  return preg_replace('/<\/?protect>/', "", $input);
 }
 
 
index e71ae2c..fa6123a 100644 (file)
@@ -20,6 +20,7 @@
 
 require_once 'Plugin/Filter.php';
 require_once 'classTextile.php';
+require_once 'diogenes.text.inc.php';
 
 /** The TextileMarkup plugin allows you to render Textile markup into XHTML.
  */