Skip to content

Commit

Permalink
🐛 fix #946
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 11, 2021
1 parent ef3652e commit 6b39a68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@

### v3.8.3 / 2021-02-xx

* [949](https://github.com/Vanessa219/vditor/issues/949) lute.Md2HTML 3.7.5 后解析无 id 属性 `修复缺陷` TODO
* [946](https://github.com/Vanessa219/vditor/issues/946) Improve the delete behavior in the list item after the code block `修复缺陷`
* [949](https://github.com/Vanessa219/vditor/issues/949) lute.Md2HTML 3.7.5 后解析无 id 属性 `修复缺陷`
* [936](https://github.com/Vanessa219/vditor/issues/936) Auto link `.app` domain suffix `改进功能`
* [926](https://github.com/Vanessa219/vditor/issues/926) 即时渲染和所见即所得模式支持点击链接 `引入特性`

Expand Down
1 change: 1 addition & 0 deletions src/ts/ir/processKeydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => {
}

if (blockElement && blockElement.previousElementSibling
&& blockElement.tagName !== "UL" && blockElement.tagName !== "OL"
&& (blockElement.previousElementSibling.getAttribute("data-type") === "code-block" ||
blockElement.previousElementSibling.getAttribute("data-type") === "math-block")) {
const rangeStart = getSelectPosition(blockElement, vditor.ir.element, range).start;
Expand Down
5 changes: 4 additions & 1 deletion src/ts/wysiwyg/processKeydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => {
if (blockElement) {
if (blockElement.previousElementSibling
&& blockElement.previousElementSibling.classList.contains("vditor-wysiwyg__block")
&& blockElement.previousElementSibling.getAttribute("data-block") === "0") {
&& blockElement.previousElementSibling.getAttribute("data-block") === "0"
// https://github.com/Vanessa219/vditor/issues/946
&& blockElement.tagName !== "UL" && blockElement.tagName !== "OL"
) {
const rangeStart = getSelectPosition(blockElement, vditor.wysiwyg.element, range).start;
if ((rangeStart === 0 && range.startOffset === 0) || // https://github.com/Vanessa219/vditor/issues/894
(rangeStart === 1 && blockElement.innerText.startsWith(Constants.ZWSP))) {
Expand Down

0 comments on commit 6b39a68

Please sign in to comment.