diff --git a/CHANGELOG.md b/CHANGELOG.md index c9eceb862..7d1ed81a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ * [150](/~https://github.com/Vanessa219/vditor/issues/150) [suggestion] deleting heading with backspace `改进功能` * [148](/~https://github.com/Vanessa219/vditor/issues/148) 任务列表退格删除问题 `修复缺陷` * [145](/~https://github.com/Vanessa219/vditor/issues/145) [suggestion] ctrl+shift+j toggle checked `改进功能` -* [144](/~https://github.com/Vanessa219/vditor/issues/144) blockquote ctrl+. should toggle `改进功能` +* [144](/~https://github.com/Vanessa219/vditor/issues/144) ctrl+shift+. 插入 blockquote `改进功能` * [143](/~https://github.com/Vanessa219/vditor/issues/143) [suggestion] ctrl+m `改进功能` * [142](/~https://github.com/Vanessa219/vditor/issues/142) lists when indented at wysiwyg mode `修复缺陷` * [141](/~https://github.com/Vanessa219/vditor/issues/141) toolbar 添加箭头,默认表情修改 `改进功能` diff --git a/src/ts/wysiwyg/processKeydown.ts b/src/ts/wysiwyg/processKeydown.ts index 8434a9c60..2e7a754a2 100644 --- a/src/ts/wysiwyg/processKeydown.ts +++ b/src/ts/wysiwyg/processKeydown.ts @@ -381,6 +381,16 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => { return true; } } + + if (isCtrl(event) && event.shiftKey && event.key === ".") { + // 插入 blockquote + range.insertNode(document.createElement("wbr")); + blockquoteElement.innerHTML = `
${blockquoteElement.innerHTML}
`; + setRangeByWbr(vditor.wysiwyg.element, range); + afterRenderEvent(vditor); + event.preventDefault(); + return true; + } } // h1-h6 @@ -499,7 +509,7 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => { if (taskItemElement) { if (isCtrl(event) && event.shiftKey && event.key === "j") { // ctrl + shift: toggle checked - const inputElement = taskItemElement.firstElementChild as HTMLInputElement + const inputElement = taskItemElement.firstElementChild as HTMLInputElement; if (inputElement.checked) { inputElement.removeAttribute("checked"); } else {