fix: ATX heading error when press shortcut

This commit is contained in:
Jocs 2018-04-18 23:43:33 +08:00
parent ec56014040
commit 193b62023e

View File

@ -298,9 +298,9 @@ const paragraphCtrl = ContentState => {
newType = newLevel === 0 ? 'p' : `h${newLevel}`
}
start.offset += newLevel - hash.length
end.offset += newLevel - hash.length
block.text = '#'.repeat(newLevel) + partText
start.offset += newLevel - hash.length + 1
end.offset += newLevel - hash.length + 1
block.text = '#'.repeat(newLevel) + ` ${partText}`
block.type = newType
this.cursor = { start, end }
break