fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
14f922a
)
prevent empty span in a new node
author
Jan Szejko
<janek37@gmail.com>
Thu, 23 Feb 2017 16:38:04 +0000
(17:38 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 27 Mar 2018 15:01:19 +0000
(17:01 +0200)
(cherry picked from commit
0bbec0d
)
src/editor/plugins/core/core.js
patch
|
blob
|
history
diff --git
a/src/editor/plugins/core/core.js
b/src/editor/plugins/core/core.js
index
6cb39e2
..
18bf7c6
100644
(file)
--- a/
src/editor/plugins/core/core.js
+++ b/
src/editor/plugins/core/core.js
@@
-120,6
+120,11
@@
plugin.documentExtension.textNode.transformations = {
parent.contents().some(function(n) {
return move(n, newNode);
});
+ if(newNodes.second.contents()[0].getText().length === 0) {
+ newNodes.second.detach();
+ newNodes.second = parent;
+ emptyText = newNodes.second.append({text: '\u200b'}); // why? why is ZWS needed here?
+ }
}
return _.extend(newNodes, {emptyText: emptyText});