Fix E_NOTICE in rST converter
authorChristian Weiske <weiske@mogic.com>
Tue, 21 Jun 2016 07:47:48 +0000 (09:47 +0200)
committerChristian Weiske <weiske@mogic.com>
Tue, 21 Jun 2016 07:47:48 +0000 (09:47 +0200)
lib/converter/restructuredtext.php

index 149fa4a..bc20551 100644 (file)
@@ -106,7 +106,9 @@ class ReStructuredText extends Base
                     $store .= static::$simpleMap[$reader->name];
                 } else if ($reader->name == 'list') {
                     --$listLevel;
                     $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";
                     }
                     if ($listLevel == -1) {
                         $store .= "\n";
                     }