diff --git a/src/extensions/markdown/Table/Table.test.ts b/src/extensions/markdown/Table/Table.test.ts index d28e153a..064eb8cc 100644 --- a/src/extensions/markdown/Table/Table.test.ts +++ b/src/extensions/markdown/Table/Table.test.ts @@ -68,10 +68,10 @@ describe('Table extension', () => { ); }); - // TODO: fix it - it.skip('should parse table under blockquoute', () => { + it('should parse table under blockquoute', () => { const markup = [ - '', + '> ', + '> ', '> |Header 1|Header 2|Header 3|', '> |:---|:---:|---:|', '> |Text 1|Text 2|Text 3|', diff --git a/src/extensions/markdown/Table/TableSpecs/toYfm.ts b/src/extensions/markdown/Table/TableSpecs/toYfm.ts index 1da08750..26ed1a14 100644 --- a/src/extensions/markdown/Table/TableSpecs/toYfm.ts +++ b/src/extensions/markdown/Table/TableSpecs/toYfm.ts @@ -4,7 +4,7 @@ import {CellAlign, TableAttrs, TableNode} from '../const'; export const toYfm: Record = { [TableNode.Table]: (state, node) => { state.ensureNewLine(); - state.out += '\n'; + state.write('\n'); state.setNoAutoBlank(); state.renderContent(node); @@ -36,7 +36,8 @@ export const toYfm: Record = { } } - state.write('|\n'); + state.write('|'); + state.ensureNewLine(); state.closeBlock(node); }, @@ -49,17 +50,18 @@ export const toYfm: Record = { [TableNode.Row]: (state, node) => { state.renderContent(node); state.closeBlock(node); - state.out += '|\n'; + state.write('|'); + state.ensureNewLine(); }, [TableNode.HeaderCell]: (state, node) => { - state.out += '|'; + state.write('|'); state.renderInline(node); state.closeBlock(node); }, [TableNode.DataCell]: (state, node) => { - state.out += '|'; + state.write('|'); state.renderInline(node); state.closeBlock(node);