Fix incorrect code block generation when previous line contains whitespace (Fixes #39)

This commit is contained in:
Will Rossiter 2014-07-27 11:25:28 +12:00
parent b95191ea3d
commit d5d346ace8

View File

@ -72,6 +72,12 @@ class DocumentationParser {
$output = array();
foreach($lines as $i => $line) {
// if line just contains whitespace, continue down the page.
// Prevents code blocks with leading tabs adding an extra line.
if(preg_match('/^\s$/', $line)) {
continue;
}
if(!$started && preg_match('/^\t*:::\s*(.*)/', $line, $matches)) {
// first line with custom formatting
$started = true;