diff --git a/tools/doc/html.js b/tools/doc/html.js
index 8de9f49987c000..327c9f080e2bfe 100644
--- a/tools/doc/html.js
+++ b/tools/doc/html.js
@@ -159,11 +159,11 @@ function parseLists(input) {
}
if (tok.type === 'list_end') {
depth--;
+ output.push(tok);
if (depth === 0) {
state = null;
output.push({ type:'html', text: '' });
}
- output.push(tok);
return;
}
if (tok.text) {