0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Koenig - Fix error on backspace with heading as first section

This commit is contained in:
Kevin Ansfield 2018-05-09 10:23:30 +01:00
parent 8b75b37c7b
commit 4753f92fe1

View file

@ -659,7 +659,7 @@ export default Component.extend({
// if cursor is at the beginning of a heading and previous section is a
// blank paragraph, delete the blank paragraph
if (isCollapsed && offset === 0 && section.tagName.match(/^h\d$/) && section.prev.tagName === 'p' && section.prev.isBlank) {
if (isCollapsed && offset === 0 && section.tagName.match(/^h\d$/) && section.prev && section.prev.tagName === 'p' && section.prev.isBlank) {
editor.run((postEditor) => {
postEditor.removeSection(section.prev);
});