]> git.mjollnir.org Git - s9y.git/commitdiff
Apply markup plugins per-entry.
authorgarvinhicking <garvinhicking>
Tue, 21 Feb 2006 12:36:55 +0000 (12:36 +0000)
committergarvinhicking <garvinhicking>
Tue, 21 Feb 2006 12:36:55 +0000 (12:36 +0000)
13 files changed:
docs/NEWS
plugins/serendipity_event_bbcode/serendipity_event_bbcode.php
plugins/serendipity_event_contentrewrite/serendipity_event_contentrewrite.php
plugins/serendipity_event_emoticate/serendipity_event_emoticate.php
plugins/serendipity_event_entryproperties/lang_en.inc.php
plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
plugins/serendipity_event_s9ymarkup/serendipity_event_s9ymarkup.php
plugins/serendipity_event_searchhighlight/serendipity_event_searchhighlight.php
plugins/serendipity_event_textile/serendipity_event_textile.php
plugins/serendipity_event_textwiki/serendipity_event_textwiki.php
plugins/serendipity_event_trackexits/serendipity_event_trackexits.php
plugins/serendipity_event_xhtmlcleanup/serendipity_event_xhtmlcleanup.php

index b921a072f4a47bdbe081bd3f99a861e5c36b8a8b..820ed308a00c97968c5ff68ed8d71fbf141735ea 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 1.1-alpha1()
 ------------------------------------------------------------------------
 
+   * Allow entryproperties plugin to define which markup plugins are
+     applied per-entry (garvinhicking)
+
    * Added links to view an entry in reasonable places (comments / entry
      overview) (garvinhicking)
 
index f9994c3a05c6ac2f647886c484265da7046dad3d..805c6491b577bb442b8e88a464ea3b713f031e74 100644 (file)
@@ -19,7 +19,7 @@ class serendipity_event_bbcode extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_BBCODE_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Jez Hancock, Garvin Hicking');
-        $propbag->add('version',       '2.01');
+        $propbag->add('version',       '2.02');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -227,7 +227,9 @@ class serendipity_event_bbcode extends serendipity_event
                 case 'frontend_display':
 
                     foreach ($this->markup_elements as $temp) {
-                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                             $element = $temp['element'];
                             $eventData[$element] = $this->bbcode($eventData[$element]);
                         }
index 9db6f4cab5cb95d48a0738c087bb277d92b724b0..6467a93863155d2902ace6145ee67889c77686d0 100644 (file)
@@ -29,7 +29,7 @@ class serendipity_event_contentrewrite extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_CONTENTREWRITE_DESCRIPTION);
         $propbag->add('stackable',     true);
         $propbag->add('author',        'Garvin Hicking');
-        $propbag->add('version',       '1.1');
+        $propbag->add('version',       '1.2');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -253,7 +253,9 @@ class serendipity_event_contentrewrite extends serendipity_event
 
                             // \1 and \3 are the prepend/append strings (usually whitespaces) and $new containing the new value
                             foreach ($this->markup_elements as $temp) {
-                                if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                                if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                                    !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                                    !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                                     $element = $temp['element'];
                                     $eventData[$element] = preg_replace($regex, '\1' . $new . '\3', $eventData[$element]);
                                 }
index 80d1b4ace241456b0d959013c2ba2549f309d362..bd3472ba1774c8cfd54f38f2859f568b16bdfc6d 100644 (file)
@@ -20,7 +20,7 @@ class serendipity_event_emoticate extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_EMOTICATE_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Serendipity Team');
-        $propbag->add('version',       '1.2');
+        $propbag->add('version',       '1.3');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -166,7 +166,9 @@ class serendipity_event_emoticate extends serendipity_event
                 case 'frontend_display':
 
                     foreach ($this->markup_elements as $temp) {
-                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                             $element = &$eventData[$temp['element']];
 
                             foreach ($this->getEmoticons() as $key => $value) {
index 100afff544462f7bd4f29d2cc9df62d17a6a9b20..0b4cb834ca2225fa10f522f2e0280f6c96bb21d3 100644 (file)
@@ -23,7 +23,6 @@
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DONE', 'Entry caching completed.');
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_ABORTED', 'Entry caching ABORTED.');
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_TOTAL', ' (totalling %d entries)...');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR', 'Disable nl2br');
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE', 'Hide from article overview / frontpage');
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS', 'Use group-based restrictions');
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS_DESC', 'If enabled, you can define which users of a usergroup may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
@@ -37,4 +36,5 @@
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC2', 'Here you can enter a list of commaseparated field names that you can use to enter for every entry - do not use special characters or spaces for those fieldnames. Example: "Customfield1, Customfield2". ' . PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1);
 @define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC3', 'The list of available custom fields can be changed in the <a href="%s" target="_blank" title="' . PLUGIN_EVENT_ENTRYPROPERTIES_TITLE . '">plugin configuration</a>.');
 
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_DISABLE_MARKUP', 'Disable Markup plugins for this entry:');
 ?>
index 6367fdb4d24aabc1a5dfd49f5111c8a1443fe666..50aeda3e10f2135824a8150579ff83c4d3d548cf 100644 (file)
@@ -21,7 +21,7 @@ class serendipity_event_entryproperties extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_ENTRYPROPERTIES_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Garvin Hicking');
-        $propbag->add('version',       '1.8');
+        $propbag->add('version',       '1.9');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -42,7 +42,8 @@ class serendipity_event_entryproperties extends serendipity_event
             'backend_cache_purge'                               => true,
             'backend_plugins_new_instance'                      => true,
             'frontend_entryproperties_query'                    => true,
-            'frontend_entries_rss'                              => true
+            'frontend_entries_rss'                              => true,
+            'backend_entry_presave'                             => true
         ));
         $propbag->add('groups', array('BACKEND_EDITOR'));
         $propbag->add('configuration', array('cache', 'use_groups', 'use_users', 'default_read', 'customfields'));
@@ -135,7 +136,7 @@ class serendipity_event_entryproperties extends serendipity_event
         static $supported_properties = null;
 
         if ($supported_properties === null) {
-            $supported_properties = array('is_sticky', 'access', 'access_groups', 'access_users', 'cache_body', 'cache_extended', 'no_nl2br', 'no_frontpage', 'hiderss');
+            $supported_properties = array('is_sticky', 'access', 'access_groups', 'access_users', 'cache_body', 'cache_extended', 'no_frontpage', 'hiderss');
 
             $fields = explode(',', trim($this->get_config('customfields')));
             if (is_array($fields) && count($fields) > 0) {
@@ -160,12 +161,36 @@ class serendipity_event_entryproperties extends serendipity_event
         return $and;
     }
 
+    /*
+     * This function converts specific property fields so that they are
+     * available natively to other plugins/templates.
+     */
+    function applyProperties(&$properties) {
+        global $serendipity;
+
+        if (is_array($properties['disable_markups'])) {
+            foreach($properties['disable_markups'] AS $idx => $instance) {
+                $properties['disable_markup_' . $instance] = $instance;
+            }
+        }
+    }
+
     function addProperties(&$properties, &$eventData) {
         global $serendipity;
         // Get existing data
         $property = serendipity_fetchEntryProperties($eventData['id']);
         $supported_properties = serendipity_event_entryproperties::getSupportedProperties();
 
+        // Special case for disable markups.
+        if (is_array($properties['disable_markups'])) {
+            $q = "DELETE FROM {$serendipity['dbPrefix']}entryproperties WHERE entryid = " . (int)$eventData['id'] . " AND property LIKE 'ep_disable_markup_%'";
+            serendipity_db_query($q);
+
+            foreach($properties['disable_markups'] AS $idx => $instance) {
+                $supported_properties[] = 'disable_markup_' . $instance;
+            }
+        }
+        
         foreach($supported_properties AS $prop_key) {
             $prop_val = (isset($properties[$prop_key]) ? $properties[$prop_key] : null);
             $prop_key = 'ep_' . $prop_key;
@@ -204,10 +229,6 @@ class serendipity_event_entryproperties extends serendipity_event
                                  || (isset($serendipity['POST']['properties']['is_sticky']) && serendipity_db_bool($serendipity['POST']['properties']['is_sticky']))
                                ? 'checked="checked"'
                                : '';
-                    $nl2br     =    (isset($eventData['properties']['ep_no_nl2br']) && serendipity_db_bool($eventData['properties']['ep_no_nl2br']))
-                                 || (isset($serendipity['POST']['properties']['no_nl2br']) && serendipity_db_bool($serendipity['POST']['properties']['no_nl2br']))
-                               ? 'checked="checked"'
-                               : '';
 
                     $no_frontpage =    (isset($eventData['properties']['ep_no_frontpage']) && serendipity_db_bool($eventData['properties']['ep_no_frontpage']))
                                  || (isset($serendipity['POST']['properties']['no_frontpage']) && serendipity_db_bool($serendipity['POST']['properties']['no_frontpage']))
@@ -255,11 +276,6 @@ class serendipity_event_entryproperties extends serendipity_event
                                 <label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS; ?>" for="properties_is_sticky">&nbsp;<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS; ?>&nbsp;&nbsp;</label><br />
                             <input type="checkbox" name="serendipity[properties][no_frontpage]" id="properties_no_frontpage" value="true" <?php echo $no_frontpage; ?> />
                                 <label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE; ?>" for="properties_no_frontpage">&nbsp;<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE; ?>&nbsp;&nbsp;</label><br />
-<?php if (class_exists('serendipity_event_nl2br')){ ?>
-                            <input type="checkbox" name="serendipity[properties][no_nl2br]" id="properties_no_nl2br" value="true" <?php echo $nl2br; ?> />
-                                <label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR; ?>" for="properties_no_nl2br">&nbsp;<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR; ?>&nbsp;&nbsp;</label><br />
-
-<?php } ?>
                             <input type="checkbox" name="serendipity[properties][hiderss]" id="properties_hiderss" value="true" <?php echo $hiderss; ?> />
                                 <label title="<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS_DESC; ?>" for="properties_hiderss">&nbsp;<?php echo PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS; ?>&nbsp;&nbsp;</label><br />
 
@@ -323,6 +339,38 @@ class serendipity_event_entryproperties extends serendipity_event
                                 </select>
                             </div>
 
+                            <br />
+                            <div class="entryproperties_markup">
+                            <?php echo PLUGIN_EVENT_ENTRYPROPERTIES_DISABLE_MARKUP; ?><br />
+                            <div style="margin-left: 10px">
+                                <select name="serendipity[properties][disable_markups][]" multiple="multiple" size="4">
+                                <?php
+                                $plugins = serendipity_plugin_api::get_event_plugins();
+                        
+                                if (is_array($plugins)) {
+                                    // foreach() operates on copies of values, but we want to operate on references, so we use while()
+                                    @reset($plugins);
+                                    while(list($plugin, $plugin_data) = each($plugins)) {
+                                        if (!is_array($plugin_data['p']->markup_elements)) {
+                                            continue;
+                                        }
+
+                                        if (isset($serendipity['POST']['properties']['disable_markups']) && in_array($plugin_data['p']->instance, $serendipity['POST']['properties']['disable_markups'])) {
+                                            $selected = true;
+                                        } elseif (isset($eventData['properties']['ep_disable_markup_' . $plugin_data['p']->instance])) {
+                                            $selected = true;
+                                        } else {
+                                            $selected = false;
+                                        }
+                                        
+                                        echo '<option ' . ($selected ? 'selected="selected"' : '') . ' value="' . $plugin_data['p']->instance . '">' . htmlspecialchars($plugin_data['p']->title) . '</option>' . "\n";
+                                    }
+                                }
+                                ?>
+                                </select>
+                            </div>
+                        </div>
+
                             <?php
                                 $fields = trim($this->get_config('customfields'));
                                 if (!empty($fields)) {
@@ -371,6 +419,7 @@ class serendipity_event_entryproperties extends serendipity_event
                     }
                     return true;
                     break;
+
                 case 'backend_import_entry':
                     //TODO: (ph) Maybe handle caching?
                     if (is_array($addData) && !$addData['nl2br']){
@@ -379,6 +428,7 @@ class serendipity_event_entryproperties extends serendipity_event
                         $this->addProperties($props, $eventData);
                     }
                 break;
+
                 case 'backend_sidebar_entries_event_display_buildcache':
                     if ($is_cache) {
                         $per_fetch = 25;
@@ -457,6 +507,12 @@ class serendipity_event_entryproperties extends serendipity_event
                     serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}entryproperties WHERE property LIKE 'ep_cache_%'");
                     break;
 
+                case 'backend_entry_presave':
+                    if (is_array($serendipity['POST']['properties'])) {
+                        $this->applyProperties($serendipity['POST']['properties']);
+                    }
+                    break;
+
                 case 'backend_publish':
                 case 'backend_save':
                     if (!isset($serendipity['POST']['properties']) || !is_array($serendipity['POST']['properties']) || !isset($eventData['id'])) {
index 60db21e4aa6bf3330e14e8f6332a1067331dd21a..c686219cb0f62f7ec6d95a63fbcf5279df5f9b95 100644 (file)
@@ -20,7 +20,7 @@ class serendipity_event_nl2br extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_NL2BR_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Serendipity Team');
-        $propbag->add('version',       '1.3');
+        $propbag->add('version',       '1.4');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -89,8 +89,11 @@ class serendipity_event_nl2br extends serendipity_event
 
                 foreach ($this->markup_elements as $temp) {
                     if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance]) &&
                             !$eventData['properties']['ep_no_nl2br'] &&
-                            !isset($serendipity['POST']['properties']['no_nl2br'])) {
+                            !isset($serendipity['POST']['properties']['ep_no_nl2br'])) {
+
                         $element = $temp['element'];
                         $eventData[$element] = nl2br($eventData[$element]);
                     }
index 971d414cdd04e51ebb376c1bdef88e2b2f0987b9..a6294b9fe64912d6339e82b0226ce04c95ce10fc 100644 (file)
@@ -20,7 +20,7 @@ class serendipity_event_s9ymarkup extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_S9YMARKUP_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Serendipity Team');
-        $propbag->add('version',       '1.1');
+        $propbag->add('version',       '1.2');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -90,7 +90,9 @@ class serendipity_event_s9ymarkup extends serendipity_event
                 case 'frontend_display':
 
                     foreach ($this->markup_elements as $temp) {
-                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                             $element = $temp['element'];
                             $eventData[$element] = $this->_s9y_markup($eventData[$element]);
                         }
index 5adb101606f9c53564b84a76ba4f0484c13ec3ea..d5aa86f692a34e5016babe3d8edd01a4a241d27d 100644 (file)
@@ -24,7 +24,7 @@ class serendipity_event_searchhighlight extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_SEARCHHIGHLIGHT_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Tom Sommer');
-        $propbag->add('version',       '1.1');
+        $propbag->add('version',       '1.2');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -192,6 +192,11 @@ class serendipity_event_searchhighlight extends serendipity_event
                     continue;
                 }
 
+                if ($eventData['properties']['ep_disable_markup_' . $this->instance] ||
+                    isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
+                    continue;
+                }
+                                
                 $element = &$eventData[$temp['element']];
 
                 foreach ( $queries as $word ) {
index cfe470eeb15e8ef6d27b623b986d1460cba178c0..c28f22b3f8e08a706875515763d4c41e862c040b 100644 (file)
@@ -22,7 +22,7 @@ class serendipity_event_textile extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_TEXTILE_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Serendipity Team');
-        $propbag->add('version',       '1.1');
+        $propbag->add('version',       '1.2');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -103,6 +103,10 @@ class serendipity_event_textile extends serendipity_event
 
                 foreach ($this->markup_elements as $temp) {
                     if (serendipity_db_bool($this->get_config($temp['name'], true))) {
+                        if ($eventData['properties']['ep_disable_markup_' . $this->instance] ||
+                            isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
+                            continue;
+                        }
                         $element = $temp['element'];
 
         /* find all the tags and store them in $blocks */
index 699f5e7b3789f563ad28c224c2814a23e782ee7a..0342dbc34d223355dbbfe2a85d032c0dd1d9e707 100644 (file)
@@ -461,7 +461,7 @@ class serendipity_event_textwiki extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_TEXTWIKI_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Tobias Schlitt');
-        $propbag->add('version',       '1.2');
+        $propbag->add('version',       '1.3');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -585,7 +585,9 @@ class serendipity_event_textwiki extends serendipity_event
             switch($event) {
                 case 'frontend_display':
                     foreach ($this->markup_elements as $temp) {
-                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                             $element = $temp['element'];
                             $eventData[$element] = $this->wiki->transform($eventData[$element]);
                         }
index 14b05f3f45d9ea79f3eb1872cd65bee734034907..545de7ec3f51c7c0eca25d3edad07a45b0e1b92e 100644 (file)
@@ -21,7 +21,7 @@ class serendipity_event_trackexits extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_TRACKBACK_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Serendipity Team');
-        $propbag->add('version',       '1.5');
+        $propbag->add('version',       '1.6');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -117,7 +117,9 @@ class serendipity_event_trackexits extends serendipity_event
                     }
 
                     foreach ($this->markup_elements as $temp) {
-                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                             $element = $temp['element'];
 
                             $eventData[$element] = preg_replace_callback(
index e9c1dd116641280f6b57b963dbb6d8391f17bb5b..35621f4b8671d343c7280d4b28cb1ec85052cfe8 100644 (file)
@@ -32,7 +32,7 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_XHTMLCLEANUP_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Garvin Hicking');
-        $propbag->add('version',       '1.4');
+        $propbag->add('version',       '1.5');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -138,7 +138,9 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
                 case 'frontend_display':
                     $this->cleanup_parse = serendipity_db_bool($this->get_config('xhtml_parse'));
                     foreach ($this->markup_elements as $temp) {
-                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']])) {
+                        if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
+                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
+                            !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
                             $element = $temp['element'];
                             $this->cleanup_tag      = 'IMG';
                             $this->cleanup_checkfor = 'ALT';