|
|
@@ -169,7 +169,8 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => {
|
|
|
}
|
|
|
|
|
|
if (blockElement && blockElement.previousElementSibling
|
|
|
- && blockElement.previousElementSibling.getAttribute("data-type") === "code-block") {
|
|
|
+ && (blockElement.previousElementSibling.getAttribute("data-type") === "code-block" ||
|
|
|
+ blockElement.previousElementSibling.getAttribute("data-type") === "math-block")) {
|
|
|
const rangeStart = getSelectPosition(blockElement, vditor.ir.element, range).start;
|
|
|
if (rangeStart === 0 || (rangeStart === 1 && blockElement.innerText.startsWith(Constants.ZWSP))) {
|
|
|
// 当前块删除后光标落于代码渲染块上,当前块会被删除,因此需要阻止事件,不能和 keyup 中的代码块处理合并
|