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:
a3899fd
)
new node after header is paragraph
author
Jan Szejko
<janek37@gmail.com>
Fri, 24 Feb 2017 16:23:28 +0000
(17:23 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 24 Feb 2017 16:23:28 +0000
(17:23 +0100)
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
9a333d0
..
d2791d0
100644
(file)
--- a/
src/editor/plugins/core/core.js
+++ b/
src/editor/plugins/core/core.js
@@
-123,12
+123,19
@@
plugin.documentExtension.textNode.transformations = {
return move(n, newNode);
});
if(newNodes.second.contents()[0].getText().length === 0) {
return move(n, newNode);
});
if(newNodes.second.contents()[0].getText().length === 0) {
+ var textNode = newNodes.second.contents()[0];
newNodes.second.detach();
newNodes.second = parent;
newNodes.second.detach();
newNodes.second = parent;
- emptyText = newNodes.second.append(
{text: '\u200b'}); // why? why is ZWS needed here?
+ emptyText = newNodes.second.append(
textNode);
}
}
}
}
+ var newNodeText = newNodes.second.contents()[0].getText();
+ if(newNodes.second.is({tagName: 'header'}) && newNodeText === '') {
+ newNodes.second = newNodes.second.setTag('div');
+ newNodes.second.setClass('p');
+ }
+
return _.extend(newNodes, {emptyText: emptyText});
}
},
return _.extend(newNodes, {emptyText: emptyText});
}
},