/** * 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']); } }
/** * Parses content in a restricted mode. * * @param string|null $text The input document in textile format * @param bool|null $lite Optional flag to switch the parser into lite mode * @param bool|null $noimage Optional flag controlling the conversion of images into HTML img tags * @param string|null $rel Relationship to apply to all generated links * @return string The text from the input document */ public function textileRestricted($text, $lite = null, $noimage = null, $rel = null) { if ($lite === null) { $lite = get_pref('comments_use_fat_textile', 1); } if ($noimage === null) { $noimage = get_pref('comments_disallow_images', 1); } if ($rel === null && get_pref('comment_nofollow', 1)) { $rel = 'nofollow'; } return parent::textileRestricted($text, $lite, $noimage, $rel); }
public function parse_string($template, $data = array(), $return = FALSE, $options = array()) { if (!is_array($options)) { $options = array(); } $options = array_merge($this->config, $options); $ci = $this->ci; $is_mx = false; if (!$return) { list($ci, $is_mx) = $this->detect_mx(); } $parser = new Textile($options['doctype']); if ($options['restricted_mode']) { $template = $parser->textileRestricted($template); } else { $template = $parser->textileThis($template); } return $this->output($template, $return, $ci, $is_mx); }