Fix horizontal rule interactions

Closes #326
This commit is contained in:
Tom Moor
2017-10-19 22:00:07 -07:00
parent e4e2ac8aa1
commit 98986fe226
4 changed files with 39 additions and 12 deletions

View File

@ -112,19 +112,17 @@ export default function MarkdownShortcuts() {
if (chars === '--') {
ev.preventDefault();
const transform = state
return state
.transform()
.extendToStartOf(startBlock)
.delete()
.setBlock({
type: 'horizontal-rule',
isVoid: true,
});
state = transform
})
.collapseToStartOfNextBlock()
.insertBlock('paragraph')
.apply();
return state;
}
},