diff --git a/apps/editor/src/__test__/unit/convertor.spec.ts b/apps/editor/src/__test__/unit/convertor.spec.ts index 6bd84dd137..15ec956a20 100644 --- a/apps/editor/src/__test__/unit/convertor.spec.ts +++ b/apps/editor/src/__test__/unit/convertor.spec.ts @@ -405,11 +405,11 @@ describe('Convertor', () => { bar -
+ baz -
-
+ + qux `; @@ -441,21 +441,21 @@ describe('Convertor', () => { const expected = source` foo -
+ bar -
-
+ + baz -
+ qux -
+ quux -
-
+ + quuz `; @@ -1062,36 +1062,6 @@ describe('Convertor', () => { }); }); - it('should convert empty line between lists of wysiwig to
', () => { - const wwNodeJson = { - type: 'doc', - content: [ - { - type: 'bulletList', - content: [ - { - type: 'listItem', - content: [ - { type: 'paragraph', content: [{ type: 'text', text: 'test_1' }] }, - { type: 'paragraph', content: [] }, - ], - }, - { - type: 'listItem', - content: [{ type: 'paragraph', content: [{ type: 'text', text: 'test_2' }] }], - }, - ], - }, - ], - }; - - const wwNode = Node.fromJSON(schema, wwNodeJson); - - const result = convertor.toMarkdownText(wwNode); - - expect(result).toBe(`* test\\_1\n
\n* test\\_2`); - }); - it('should escape the backslash, which is a plain chracter in the middle of a sentence', () => { const markdown = source` backslash \\in the middle of a sentence diff --git a/apps/editor/src/convertors/toMarkdown/toMdNodeTypeWriters.ts b/apps/editor/src/convertors/toMarkdown/toMdNodeTypeWriters.ts index 2cf7e16e0f..9ddbc8d2ed 100644 --- a/apps/editor/src/convertors/toMarkdown/toMdNodeTypeWriters.ts +++ b/apps/editor/src/convertors/toMarkdown/toMdNodeTypeWriters.ts @@ -81,16 +81,8 @@ export const nodeTypeWriters: ToMdNodeTypeWriterMap = { const emptyNode = node.childCount === 0; if (emptyNode && prevEmptyNode) { - state.write('
\n'); + state.write(' \n'); } else if (emptyNode && !prevEmptyNode && !firstChildNode) { - if (parent?.type.name === 'listItem') { - const prevDelim = state.getDelim(); - - state.setDelim(''); - state.write('
'); - - state.setDelim(prevDelim); - } state.write('\n'); } else { state.convertInline(node);