mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 05:40:39 +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}`
|
||||
}
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user