public static function run($content, $force = false) { $output = $content; if (Config::get('letterpress.markdown.enabled') || $force) { $escaper = new Escaper('/(?P<bbcode>\\[.+?\\].+\\[\\/.+?\\])/', 'bbcode'); $output = $escaper->escape($output); if (!is_a(static::$parsedown, \Parsedown::class)) { static::$parsedown = ParsedownFactory::create(); } $output = static::$parsedown->text($output); $output = $escaper->replace($output); } return $output; }
/** * @dataProvider lineBreaksData */ public function testLineBreaks($enabled, $actual, $expected) { Config::set('letterpress.markdown.enableLineBreaks', $enabled); $instance = ParsedownFactory::create(); $this->assertEquals($expected, $instance->text($actual)); }