. */ /** * Textile filter. * * @since 4.6.0 * @package Textfilter */ namespace Textpattern\Textfilter; class Textile extends Base implements TextfilterInterface { /** * Instance of Textile. * * @var Textile */ protected $textile; /** * Constructor. */ public function __construct() { parent::__construct(USE_TEXTILE, gTxt('use_textile')); $this->textile = new \Textpattern\Textile\Parser(); $this->version = $this->textile->getVersion(); } /** * Filter. * * @param string $thing * @param array $options */ public function filter($thing, $options) { parent::filter($thing, $options); if (($this->options['restricted'])) { return $this->textile->textileRestricted( $thing, $this->options['lite'], $this->options['noimage'], $this->options['rel'] ); } else { return $this->textile->textileThis( $thing, $this->options['lite'], '', $this->options['noimage'], '', $this->options['rel'] ); } } /** * Help for Textile syntax. * * Gives some basic Textile syntax examples, wrapped in an <ul>. * * @return string HTML */ public function getHelp() { return n.''. graf( href(gTxt('documentation').sp.span(gTxt('opens_external_link'), array('class' => 'ui-icon ui-icon-extlink')), 'http://textpattern.com/textile-sandbox', array( 'class' => 'textile-docs-link', 'rel' => 'external', 'target' => '_blank', )) ); } }