X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/a375467d42cb53599ffddbd1d7ce8fae028972f8..HEAD:/lib/converter/restructuredtext.php diff --git a/lib/converter/restructuredtext.php b/lib/converter/restructuredtext.php index 8419af6..bc20551 100644 --- a/lib/converter/restructuredtext.php +++ b/lib/converter/restructuredtext.php @@ -106,7 +106,9 @@ class ReStructuredText extends Base $store .= static::$simpleMap[$reader->name]; } else if ($reader->name == 'list') { --$listLevel; - $listPrefix = str_repeat(' ', $listLevel); + $listPrefix = str_repeat( + ' ', $listLevel < 0 ? 0 : $listLevel + ); if ($listLevel == -1) { $store .= "\n"; } @@ -134,7 +136,7 @@ class ReStructuredText extends Base $headingLength = strlen(trim($reader->value)); $store .= trim($reader->value); } else { - $text = wordwrap($reader->value, 72 - 2 * $listLevel, "\n", true); + $text = wordwrap($reader->value, 72 - 2 * $listLevel, "\n"); $parts = explode("\n", $text); foreach ($parts as $k => $v) { if ($k == 0) {