Skip to content

Commit

Permalink
🎨 fix #144
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 20, 2020
1 parent 6c1fdc1 commit 0b6fb04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 添加箭头,默认表情修改 `改进功能`
Expand Down
12 changes: 11 additions & 1 deletion src/ts/wysiwyg/processKeydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `<blockquote data-block="0">${blockquoteElement.innerHTML}</blockquote>`;
setRangeByWbr(vditor.wysiwyg.element, range);
afterRenderEvent(vditor);
event.preventDefault();
return true;
}
}

// h1-h6
Expand Down Expand Up @@ -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 {
Expand Down

2 comments on commit 0b6fb04

@jakekwak
Copy link
Contributor

@jakekwak jakekwak commented on 0b6fb04 Feb 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think should be >, J when CAPSLOCK is off

@Vanessa219
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.