public function smartypantsFilter($content, $options = null) { if (!$options) { $options = $this->config->get('plugins.smartypants.options'); } $smartypants = new \Michelf\SmartyPantsTypographer($options); if ($this->config->get('plugins.smartypants.dq_open')) { $smartypants->smart_doublequote_open = $this->config->get('plugins.smartypants.dq_open'); } if ($this->config->get('plugins.smartypants.dq_close')) { $smartypants->smart_doublequote_close = $this->config->get('plugins.smartypants.dq_close'); } if ($this->config->get('plugins.smartypants.sq_open')) { $smartypants->smart_singlequote_open = $this->config->get('plugins.smartypants.sq_open'); } if ($this->config->get('plugins.smartypants.sq_close')) { $smartypants->smart_singlequote_close = $this->config->get('plugins.smartypants.sq_close'); } return $smartypants->transform($content); }
/** * Apply SmartyPants transformation on raw text. * * @param string $text Raw text * @param object $config Configuration object * @return string Transformed text */ protected function transform($text, $config) { $smartypants = new \Michelf\SmartyPantsTypographer($config->get('options')); if ($config->get('dq_open')) { $smartypants->smart_doublequote_open = $config->get('dq_open'); } if ($config->get('dq_close')) { $smartypants->smart_doublequote_close = $config->get('dq_close'); } if ($config->get('sq_open')) { $smartypants->smart_singlequote_open = $config->get('sq_open'); } if ($config->get('sq_close')) { $smartypants->smart_singlequote_close = $config->get('sq_close'); } return $smartypants->transform($text); }