Skip to content

Commit 943ad30

Browse files
committed
fix(tostring) standalone items raise an error
Signed-off-by: Jerome Simeon <[email protected]>
1 parent ef9e55d commit 943ad30

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/markdown-common/src/ToMarkdownStringVisitor.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,7 @@ class ToStringVisitor {
200200
}
201201
break;
202202
case 'Item':
203-
if(parameters.type === 'ordered') {
204-
parameters.result += '\n${ToStringVisitor.mkIndent(parameters)}$1. ';
205-
}
206-
else {
207-
parameters.result += '\n${ToStringVisitor.mkIndent(parameters)}- ';
208-
}
209-
parameters.result += ToStringVisitor.visitChildren(this, thing);
210-
break;
203+
throw new Error('Item node should not occur outside of List nodes');
211204
case 'Document':
212205
parameters.result += ToStringVisitor.visitChildren(this, thing);
213206
break;

0 commit comments

Comments
 (0)