Skip to content

Commit

Permalink
dont pass in null text
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jun 17, 2018
1 parent d19ebb4 commit 9a6d3dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ class Quill {
source,
);
});
const contents = this.clipboard.convert({ html: `${html}<p><br></p>` });
const contents = this.clipboard.convert({
html: `${html}<p><br></p>`,
text: '\n',
});
this.setContents(contents);
this.history.clear();
if (this.options.placeholder) {
Expand Down
4 changes: 2 additions & 2 deletions modules/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ class Clipboard extends Module {

dangerouslyPasteHTML(index, html, source = Quill.sources.API) {
if (typeof index === 'string') {
const delta = this.convert({ html: index });
const delta = this.convert({ html: index, text: '' });
this.quill.setContents(delta, html);
this.quill.setSelection(0, Quill.sources.SILENT);
} else {
const paste = this.convert({ html });
const paste = this.convert({ html, text: '' });
this.quill.updateContents(
new Delta().retain(index).concat(paste),
source,
Expand Down

0 comments on commit 9a6d3dc

Please sign in to comment.