diff --git a/exec/load/markdown.js b/exec/load/markdown.js
index e861f45a750a0a666021d48e9bcfbea4051c3be0..878e8ea5c861866ced278bd44fd2a2129a292af6 100644
--- a/exec/load/markdown.js
+++ b/exec/load/markdown.js
@@ -271,10 +271,10 @@ Markdown.prototype.render_line_console = function (line) {
     }
     if (match[1].length > this.state.list_level) {
       this.state.list_level++;
-      if (lt == 'ol') this.state.list_stack.push(0);
+      if (lt == 'ol') this.state.list_stack[this.state.list_level] = 0;
     } else if (match[1].length < this.state.list_level) {
+      if (lt == 'ol') this.state.list_stack.splice(this.state.list_level, 1);
       this.state.list_level--;
-      if (lt == 'ol') this.state.list_stack.pop();
     } else if (lt == 'ol') {
       if (typeof this.state.list_stack[this.state.list_level] != 'number') {
         this.state.list_stack[this.state.list_level] = 0;