@@ -44,24 +44,54 @@ describe('Table extension', () => {
4444 expect ( rendered ) . toBe ( output )
4545 } )
4646
47- it ( 'markdown table is preserved through editor' , ( ) => {
47+ it ( 'simple md table is preserved through editor' , ( ) => {
4848 expect ( markdownThroughEditor ( 'a|b\n-|-\n1|2\n' ) ) . toBe (
4949 '| a | b |\n|---|---|\n| 1 | 2 |\n' ,
5050 )
51+ } )
5152
52- const complexTable = `
53+ it ( 'complex md table with alignment, nested list, image and code block is preserved through editor' , ( ) => {
54+ const table = `
5355| # | header1 | header2 |
5456|--:|------------------:|---------------|
5557| 1 | list: | code: | \\
5658| | | | \\
5759| | * item1 | \`\`\`js | \\
58- | | * item2 | const x = '1' | \\
60+ | | * item2 | const x = '1' | \\
5961| | | \`\`\` | \\
6062| |  | |
6163| 2 | cell3 | cell4 |
6264| 3 | | cell5 |
6365` . trimStart ( )
64- expect ( markdownThroughEditor ( complexTable ) ) . toBe ( complexTable )
66+
67+ expect ( markdownThroughEditor ( table ) ) . toBe ( table )
68+ } )
69+
70+ it ( 'complex md table with callout, hr, blockquote and details in nested list is preserved through editor' , ( ) => {
71+ const table = `
72+ | nested list1 | nested list 2 |
73+ |-----------------------|----------------------------------|
74+ | 1. first with callout | 1. first with blockquote | \\
75+ | | | \\
76+ | ::: info | > - quoted list item1 | \\
77+ | info | > - quoted list item2 | \\
78+ | | 1. with image | \\
79+ | ::: | | \\
80+ | 1. item2 |  | \\
81+ | 2. second | 2. summary | \\
82+ | | | \\
83+ | --- | <details> | \\
84+ | | <summary>summary</summary> | \\
85+ | ::: warn | > * quoted list item | \\
86+ | warn | | \\
87+ | | </details> | \\
88+ | ::: | |
89+ | * [ ] task list item1 | | \\
90+ | * [x] task list item2 | |
91+ | > quote | |
92+ ` . trimStart ( )
93+
94+ expect ( markdownThroughEditor ( table ) ) . toBe ( table )
6595 } )
6696
6797 test ( 'Load into editor' , ( { editor } ) => {
0 commit comments