mirror of
https://github.com/marktext/marktext.git
synced 2025-05-16 17:00:30 +08:00
fix: fix snabbdom-to-html error, and already submit an issue to snabbdom-to-html
This commit is contained in:
parent
f7c52af8f4
commit
dcb50e3de2
@ -164,11 +164,10 @@ class ContentState {
|
||||
matches.forEach((m, i) => {
|
||||
m.active = i === index
|
||||
})
|
||||
// console.log(startKey, endKey)
|
||||
const startIndex = startKey ? blocks.findIndex(block => block.key === startKey) : 0
|
||||
const endIndex = endKey ? blocks.findIndex(block => block.key === endKey) + 1 : blocks.length
|
||||
const needRenderBlocks = blocks.slice(startIndex, endIndex)
|
||||
// console.log(JSON.stringify(needRenderBlocks, null, 2), startKey, endKey)
|
||||
|
||||
this.setNextRenderRange()
|
||||
this.stateRender.partialRender(needRenderBlocks, cursor, activeBlocks, matches, startKey, endKey)
|
||||
this.pre2CodeMirror(true, [...new Set([cursorOutMostBlock, ...needRenderBlocks])])
|
||||
|
@ -433,7 +433,8 @@ class StateRender {
|
||||
} else {
|
||||
result = [ text.substring(rStart, rEnd) ]
|
||||
}
|
||||
|
||||
// fix snabbdom-to-html bug https://github.com/snabbdom/snabbdom-to-html/issues/41
|
||||
if (result.length === 1 && result[0] === '') result.length = 0
|
||||
return result
|
||||
}
|
||||
// render token of text type to vdom.
|
||||
|
@ -13,7 +13,7 @@ export default {
|
||||
}
|
||||
}, {
|
||||
label: 'Redo',
|
||||
accelerator: 'CmdOrCtrl+Y',
|
||||
accelerator: 'Shift+CmdOrCtrl+Z',
|
||||
click: (menuItem, browserWindow) => {
|
||||
actions.edit(browserWindow, 'redo')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user