]> git.mjollnir.org Git - s9y.git/commitdiff
Allow to re-convert " to " again with a config option,
authorgarvinhicking <garvinhicking>
Tue, 8 Jan 2008 10:07:11 +0000 (10:07 +0000)
committergarvinhicking <garvinhicking>
Tue, 8 Jan 2008 10:07:11 +0000 (10:07 +0000)
thanks to Lars

plugins/serendipity_event_textile/lang_en.inc.php
plugins/serendipity_event_textile/serendipity_event_textile.php

index 3fe4fa9b4386e44a0dc88ed7750aaa4a8075afed..4459dc9512ad60faaa4072bc0d41060686ebc4b9 100644 (file)
@@ -11,4 +11,5 @@
 @define('PLUGIN_EVENT_TEXTILE_TRANSFORM', '<a href="http://www.textism.com/tools/textile/">Textile</a>-formatting allowed');
 @define('PLUGIN_EVENT_TEXTILE_VERSION', 'Textile version');
 @define('PLUGIN_EVENT_TEXTILE_VERSION_DESCRIPTION', 'Which version of Textile do you want to use?');
-?>
+@define('PLUGIN_EVENT_TEXTILE_UNESCAPE', 'Convert HTML quotes to real quotes?');
+@define('PLUGIN_EVENT_TEXTILE_UNESCAPE_DESC', 'If enabled, HTML-Quote-Entities (&quot;) will be converted to real quotes. Only useful to enable, if you want to use Textile markup in your comments.');
index b87fb1b5f7db3cd95f7e8d4a5881f9fce978c938..00aa01108c3ad19f4d27495b01b19870eeae407a 100644 (file)
@@ -26,7 +26,7 @@ class serendipity_event_textile extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_TEXTILE_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Serendipity Team', 'Lars Strojny');
-        $propbag->add('version',       '1.5');
+        $propbag->add('version',       '1.6');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -68,6 +68,7 @@ class serendipity_event_textile extends serendipity_event
             $conf_array[] = $element['name'];
         }
         $conf_array[] = 'textile_version';
+        $conf_array[] = 'unescape';
         $propbag->add('configuration', $conf_array);
     }
 
@@ -97,7 +98,14 @@ class serendipity_event_textile extends serendipity_event
             ));
             $propbag->add('default',     2);
             return true;
+        } elseif ($name === 'unescape') {
+            $propbag->add('type',        'boolean');
+            $propbag->add('name',        PLUGIN_EVENT_TEXTILE_UNESCAPE);
+            $propbag->add('description', PLUGIN_EVENT_TEXTILE_UNESCAPE_DESC);
+            $propbag->add('default',     'false');
+            return true;
         }
+
         $propbag->add('type',        'boolean');
         $propbag->add('name',        constant($name));
         $propbag->add('description', sprintf(APPLY_MARKUP_TO, constant($name)));
@@ -144,6 +152,9 @@ class serendipity_event_textile extends serendipity_event
 
         /* textile it */
 
+                        if (serendipity_db_bool($this->get_config('unescape'))) {
+                            $eventData[$element] = str_replace('&quot;', '"', $eventData[$element]);
+                        }
                         $eventData[$element] = $this->textile($eventData[$element]);
 
         /* each block will now be "<code>BLOCK::2</code>"