slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.52k stars 3.38k forks source link

how can i insert a \n at quill2.0 table cell? #2528

Closed hakonleung closed 5 years ago

hakonleung commented 5 years ago

Discription: using table module, there is only a table in editor area

Executing:

quill.updateContents({ops: [{
insert: '\n'
}]})

Expected behavior: first cell should be

<table><tbody><tr><td>/*first cell*/<p><br></p></td></tr></tbody></table>

Actual behavior:

<p><br></p>

now content`s html is

<p><br></p>
<table><tbody><tr><td>/*first cell*/</td></tr></tbody></table>

how can i insert a \n at table cell?

Version: v2.0.0-dev

benbro commented 5 years ago

The dev release of tables doesn't support multiple lines per cell:

Does not allow multiple lines per cell or block level embeds (video) in cells

Even if it did, you should probably add {retain: X} op before your insert op.

hakonleung commented 5 years ago

The dev release of tables doesn't support multiple lines per cell:

Does not allow multiple lines per cell or block level embeds (video) in cells

Even if it did, you should probably add {retain: X} op before your insert op.

thx, btw i just wanna insert \n at index 0.