textile 1.8 - added doctype option
This commit is contained in:
parent
c1ce562326
commit
80ee710b6f
@ -4,14 +4,23 @@
|
||||
* @version 1.0
|
||||
* @author Konrad Bauckmeier <kontakt@dd4kids.de>
|
||||
* @translated 2009/06/03
|
||||
*/
|
||||
@define('PLUGIN_EVENT_TEXTILE_NAME', 'Textformatierung: Textile');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DESC', 'Textile-Formatierung durchführen');
|
||||
@define('PLUGIN_EVENT_TEXTILE_TRANSFORM', '<a href="%s">Textile</a>-Formatierung erlaubt');
|
||||
@define('PLUGIN_EVENT_TEXTILE_VERSION', 'Textile-Version');
|
||||
*/
|
||||
|
||||
@define('PLUGIN_EVENT_TEXTILE_NAME', 'Textformatierung: Textile');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DESC', 'Textile-Formatierung durchführen');
|
||||
@define('PLUGIN_EVENT_TEXTILE_TRANSFORM', '<a href="%s">Textile</a>-Formatierung erlaubt');
|
||||
@define('PLUGIN_EVENT_TEXTILE_VERSION', 'Textile-Version');
|
||||
@define('PLUGIN_EVENT_TEXTILE_VERSION_DESCRIPTION', 'Welche Version von Textile soll verwendet werden?');
|
||||
|
||||
// Next lines were translated on 2009/06/03
|
||||
@define('PLUGIN_EVENT_TEXTILE_UNESCAPE', 'HTML Anführungszeichen in richtige Anführungszeichen umwandeln?');
|
||||
@define('PLUGIN_EVENT_TEXTILE_UNESCAPE_DESC', 'Wenn aktiviert werden HTML-Quote-Entities (") in richtige Anführungszeichen umgewandelt. Wird nur benötigt, wenn Textile Auszeichnung in Kommentaren verwendet werden soll, damit Links dargestellt werden können.');
|
||||
|
||||
// Next lines were translated on 2014/01/06
|
||||
@define('PLUGIN_EVENT_TEXTILE_EXAMPLE_NOTE', 'Achtung: Die besten Resulte werden erzielt, wenn dieses Plugin an der Spitze aller markup Plugins, aber <u>nach</u> emoticate in der Pluginliste steht!');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DOCTYPE', 'Textile: Konvertiere nach HTML5 (nur mit lib3 - benötigt ein HTML5 Template, wie 2k11)');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DOCTYPE_DESC', 'Momentan kann PHP-Textile entweder XHTML (default) oder HTML5 Quellcode produzieren. Im HTML5 Modus werden, außer dem single-tag Endungen, nur kleinere Änderungen, wie acronym zu abbr und align Attribute in Images zu Klassen vorgenommen.');
|
||||
// todo: future
|
||||
#@define('PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS', 'Textile: Restrict user comments (lib3 only)');
|
||||
#@define('PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS_DESC', 'This method does not allow enhanced formatting options such as inline style, and removes any raw HTML to user-supplied input.');
|
||||
|
||||
|
@ -5,14 +5,22 @@
|
||||
* @author Konrad Bauckmeier <kontakt@dd4kids.de>
|
||||
* @translated 2009/06/03
|
||||
*/
|
||||
|
||||
@define('PLUGIN_EVENT_TEXTILE_NAME', 'Textformatierung: Textile');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DESC', 'Textile-Formatierung durchführen');
|
||||
@define('PLUGIN_EVENT_TEXTILE_TRANSFORM', '<a href="%s">Textile</a>-Formatierung erlaubt');
|
||||
@define('PLUGIN_EVENT_TEXTILE_VERSION', 'Textile-Version');
|
||||
|
||||
@define('PLUGIN_EVENT_TEXTILE_NAME', 'Textformatierung: Textile');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DESC', 'Textile-Formatierung durchführen');
|
||||
@define('PLUGIN_EVENT_TEXTILE_TRANSFORM', '<a href="%s">Textile</a>-Formatierung erlaubt');
|
||||
@define('PLUGIN_EVENT_TEXTILE_VERSION', 'Textile-Version');
|
||||
@define('PLUGIN_EVENT_TEXTILE_VERSION_DESCRIPTION', 'Welche Version von Textile soll verwendet werden?');
|
||||
|
||||
// Next lines were translated on 2009/06/03
|
||||
@define('PLUGIN_EVENT_TEXTILE_UNESCAPE', 'HTML Anführungszeichen in richtige Anführungszeichen umwandeln?');
|
||||
@define('PLUGIN_EVENT_TEXTILE_UNESCAPE_DESC', 'Wenn aktiviert werden HTML-Quote-Entities (") in richtige Anführungszeichen umgewandelt. Wird nur benötigt, wenn Textile Auszeichnung in Kommentaren verwendet werden soll, damit Links dargestellt werden können.');
|
||||
|
||||
// Next lines were translated on 2014/01/06
|
||||
@define('PLUGIN_EVENT_TEXTILE_EXAMPLE_NOTE', 'Achtung: Die besten Resulte werden erzielt, wenn dieses Plugin an der Spitze aller markup Plugins, aber <u>nach</u> emoticate in der Pluginliste steht!');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DOCTYPE', 'Textile: Konvertiere nach HTML5 (nur mit lib3 - benötigt ein HTML5 Template, wie 2k11)');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DOCTYPE_DESC', 'Momentan kann PHP-Textile entweder XHTML (default) oder HTML5 Quellcode produzieren. Im HTML5 Modus werden, außer dem single-tag Endungen, nur kleinere Änderungen, wie acronym zu abbr und align Attribute in Images zu Klassen vorgenommen.');
|
||||
// todo: future
|
||||
#@define('PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS', 'Textile: Restrict user comments (lib3 only)');
|
||||
#@define('PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS_DESC', 'This method does not allow enhanced formatting options such as inline style, and removes any raw HTML to user-supplied input.');
|
||||
|
||||
|
@ -14,5 +14,10 @@
|
||||
@define('PLUGIN_EVENT_TEXTILE_UNESCAPE', 'Convert HTML quotes to real quotes?');
|
||||
@define('PLUGIN_EVENT_TEXTILE_UNESCAPE_DESC', 'If enabled, HTML-Quote-Entities (") will be converted to real quotes. Only useful to enable, if you want to use Textile markup in your comments.');
|
||||
|
||||
@define('PLUGIN_EVENT_TEXTILE_EXAMPLE_NOTE', 'Please note: You will get best conversion results, when you place this plugin as the first of all your markup plugins in pluginlist!');
|
||||
@define('PLUGIN_EVENT_TEXTILE_EXAMPLE_NOTE', 'Please note: You will get best conversion results, when you place this plugin as the first of all your markup plugins, but <u>underneath</u> emoticate in pluginlist!');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DOCTYPE', 'Textile: Convert to HTML5 (lib3 only - needs a HTML5 template like 2k11)');
|
||||
@define('PLUGIN_EVENT_TEXTILE_DOCTYPE_DESC', 'Currently, PHP-Textile can target either XHTML or HTML5 output with XHTML being the default for backward compatibility. In HTML5 mode, apart from single tag endings, you\'ll get abbr instead of acronym and if you use alignment markers on your images you\'ll have extra classes placed on them instead of XHTML\'s align attribute.');
|
||||
// todo: future
|
||||
#@define('PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS', 'Textile: Restrict user comments (lib3 only)');
|
||||
#@define('PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS_DESC', 'This method does not allow enhanced formatting options such as inline style, and removes any raw HTML to user-supplied input.');
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php #
|
||||
|
||||
use Netcarver\Textile\Parser as Textilev3;
|
||||
|
||||
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
||||
|
||||
class serendipity_event_textile extends serendipity_event
|
||||
@ -16,7 +14,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.7');
|
||||
$propbag->add('version', '1.8');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -58,6 +56,8 @@ class serendipity_event_textile extends serendipity_event
|
||||
$conf_array[] = $element['name'];
|
||||
}
|
||||
$conf_array[] = 'textile_version';
|
||||
$conf_array[] = 'textile_doctype';
|
||||
// todo $conf_array[] = 'textile_restrict_comments';
|
||||
$conf_array[] = 'unescape';
|
||||
$propbag->add('configuration', $conf_array);
|
||||
}
|
||||
@ -82,22 +82,42 @@ class serendipity_event_textile extends serendipity_event
|
||||
|
||||
function introspect_config_item($name, &$propbag)
|
||||
{
|
||||
if ($name === 'textile_version') {
|
||||
$propbag->add('type', 'radio');
|
||||
$propbag->add('name', PLUGIN_EVENT_TEXTILE_VERSION);
|
||||
$propbag->add('description', PLUGIN_EVENT_TEXTILE_VERSION_DESCRIPTION);
|
||||
$propbag->add('radio', array(
|
||||
'value' => array(1, 2, 3),
|
||||
'desc' => array('1.0', '2.0', '3.0'),
|
||||
));
|
||||
$propbag->add('default', 3);
|
||||
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;
|
||||
switch($name) {
|
||||
case 'textile_version':
|
||||
$propbag->add('type', 'radio');
|
||||
$propbag->add('name', PLUGIN_EVENT_TEXTILE_VERSION);
|
||||
$propbag->add('description', PLUGIN_EVENT_TEXTILE_VERSION_DESCRIPTION);
|
||||
$propbag->add('radio', array(
|
||||
'value' => array(1, 2, 3),
|
||||
'desc' => array('1.0', '2.0', '3.0'),
|
||||
));
|
||||
$propbag->add('default', 3);
|
||||
return true;
|
||||
break;
|
||||
|
||||
case 'textile_doctype':
|
||||
$propbag->add('type', 'boolean');
|
||||
$propbag->add('name', PLUGIN_EVENT_TEXTILE_DOCTYPE);
|
||||
$propbag->add('description', PLUGIN_EVENT_TEXTILE_DOCTYPE_DESC);
|
||||
$propbag->add('default', 'false');
|
||||
return true;
|
||||
break;
|
||||
|
||||
case 'textile_restrict_comments':
|
||||
$propbag->add('type', 'boolean');
|
||||
$propbag->add('name', PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS);
|
||||
$propbag->add('description', PLUGIN_EVENT_TEXTILE_RESTRICTCOMMENTS_DESC);
|
||||
$propbag->add('default', 'true');
|
||||
return true;
|
||||
break;
|
||||
|
||||
case '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;
|
||||
break;
|
||||
}
|
||||
|
||||
$propbag->add('type', 'boolean');
|
||||
@ -255,7 +275,9 @@ class serendipity_event_textile extends serendipity_event
|
||||
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/Parser.php';
|
||||
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/DataBag.php';
|
||||
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/Tag.php';
|
||||
$textile = new Textilev3();
|
||||
$textile = $this->get_config('textile_doctype') ? new \Netcarver\Textile\Parser('html5') : new \Netcarver\Textile\Parser();
|
||||
// todo check for user-supplied output to restrict
|
||||
# return $textile->textileRestricted($string);
|
||||
return $textile->textileThis($string);
|
||||
break;
|
||||
case 2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user