Allow to re-convert " to " again with a config option,

thanks to Lars
This commit is contained in:
Garvin Hicking 2008-01-08 10:07:11 +00:00
parent b99a7194f8
commit d95501665a
2 changed files with 14 additions and 2 deletions

View 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.');

View 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>"