Markdown: better <br/> placement

This commit is contained in:
Marcin Kurczewski 2013-11-21 14:56:45 +01:00
parent 6e229bf53c
commit 77c0ea7f57

View file

@ -43,7 +43,7 @@ class CustomMarkdown extends \Michelf\Markdown
protected function doHardBreaks($text)
{
return preg_replace_callback('/\n/', [&$this, '_doHardBreaks_callback'], $text);
return preg_replace_callback('/\n(?=[\[\]\(\)\w])/', [&$this, '_doHardBreaks_callback'], $text);
}
protected function doStrike($text)