mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Koenig - Fixed error on Enter if card is selected
refs https://github.com/TryGhost/Ghost/issues/9505 - depending on the location of the caret around the selected card <kbd>Enter</kbd> could throw an error due to the assumption of a `tagName` property in the enter-at-start-of-header handling
This commit is contained in:
parent
8f135264dc
commit
8dd8257bf7
@ -605,7 +605,7 @@ export default Component.extend({
|
||||
let {isCollapsed, head: {offset, section}} = editor.range;
|
||||
|
||||
// if cursor is at beginning of a heading, insert a blank paragraph above
|
||||
if (isCollapsed && offset === 0 && section.tagName.match(/^h\d$/)) {
|
||||
if (isCollapsed && offset === 0 && section.tagName && section.tagName.match(/^h\d$/)) {
|
||||
editor.run((postEditor) => {
|
||||
let newPara = postEditor.builder.createMarkupSection('p');
|
||||
let collection = section.parent.sections;
|
||||
|
Loading…
Reference in New Issue
Block a user