mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 19:30:19 +08:00
fix: ATX heading error when press shortcut
This commit is contained in:
parent
ec56014040
commit
193b62023e
@ -298,9 +298,9 @@ const paragraphCtrl = ContentState => {
|
|||||||
newType = newLevel === 0 ? 'p' : `h${newLevel}`
|
newType = newLevel === 0 ? 'p' : `h${newLevel}`
|
||||||
}
|
}
|
||||||
|
|
||||||
start.offset += newLevel - hash.length
|
start.offset += newLevel - hash.length + 1
|
||||||
end.offset += newLevel - hash.length
|
end.offset += newLevel - hash.length + 1
|
||||||
block.text = '#'.repeat(newLevel) + partText
|
block.text = '#'.repeat(newLevel) + ` ${partText}`
|
||||||
block.type = newType
|
block.type = newType
|
||||||
this.cursor = { start, end }
|
this.cursor = { start, end }
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user