Skip to content

Commit

Permalink
dont remove last newline if formatted
Browse files Browse the repository at this point in the history
allows pasting full lists for example
  • Loading branch information
jhchen committed Apr 8, 2016
1 parent caf6c8d commit 1fab1bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Clipboard extends Module {
};
let delta = traverse(this.container);
// Remove trailing newline
if (deltaEndsWith(delta, '\n')) {
if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) {
delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));
}
debug.info('convert', this.container.innerHTML, delta);
Expand Down

0 comments on commit 1fab1bd

Please sign in to comment.