diff --git a/lib/src/plugins/markdown/decoder/document_markdown_decoder.dart b/lib/src/plugins/markdown/decoder/document_markdown_decoder.dart index 2689bc533..6b1d7053c 100644 --- a/lib/src/plugins/markdown/decoder/document_markdown_decoder.dart +++ b/lib/src/plugins/markdown/decoder/document_markdown_decoder.dart @@ -223,7 +223,7 @@ class DocumentMarkdownDecoder extends Converter { return numberedListNode( attributes: { 'delta': - decoder.convert(line.substring(line.indexOf('.') + 1)).toJson(), + decoder.convert(line.substring(line.indexOf('.') + 2)).toJson(), }, ); } diff --git a/test/plugins/markdown/decoder/document_markdown_decoder_test.dart b/test/plugins/markdown/decoder/document_markdown_decoder_test.dart index 6b6bb835f..808f510b9 100644 --- a/test/plugins/markdown/decoder/document_markdown_decoder_test.dart +++ b/test/plugins/markdown/decoder/document_markdown_decoder_test.dart @@ -297,7 +297,7 @@ void main() async { "data": { "delta": [ { - "insert": " list item 1" + "insert": "list item 1" } ] } @@ -307,7 +307,7 @@ void main() async { "data": { "delta": [ { - "insert": " list item 2" + "insert": "list item 2" } ] } @@ -739,15 +739,15 @@ void main() async { { "type": "numbered_list", "children": [ - {"type": "numbered_list", "data": {"delta": [{"insert": " Which"}]}}, - {"type": "numbered_list", "data": {"delta": [{"insert": " Is"}]}}, - {"type": "numbered_list", "data": {"delta": [{"insert": " Nested"}]}} + {"type": "numbered_list", "data": {"delta": [{"insert": "Which"}]}}, + {"type": "numbered_list", "data": {"delta": [{"insert": "Is"}]}}, + {"type": "numbered_list", "data": {"delta": [{"insert": "Nested"}]}} ], - "data": {"delta": [{"insert": " Numbered List"}]} + "data": {"delta": [{"insert": "Numbered List"}]} }, { "type": "numbered_list", - "data": {"delta": [{"insert": " Back to top level"}]} + "data": {"delta": [{"insert": "Back to top level"}]} }, {"type": "paragraph", "data": {"delta": []}} ]