Skip to content

Commit

Permalink
🐛 fix #335
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Apr 20, 2020
1 parent 3fcf84d commit 6e5c354
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

### v3.1.15 / 2020-04-2x

* [335](https://github.com/Vanessa219/vditor/issues/335) 块引用嵌套列表跳出问题 `修复缺陷`
* [332](https://github.com/Vanessa219/vditor/issues/332) Not working 3rd menu at smartphone `修复缺陷`

### v3.1.14 / 2020-04-20
Expand Down
18 changes: 6 additions & 12 deletions src/ts/util/fixBrowserBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,18 +822,12 @@ export const fixBlockquote = (vditor: IVditor, range: Range, event: KeyboardEven
isEmpty = true;
}
if (isEmpty) {
if (vditor.currentMode === "wysiwyg") {
(vditor.wysiwyg.popover.querySelector('[data-type="insert-after"]') as HTMLElement).click();
event.preventDefault();
return true;
} else {
// 需添加零宽字符,否则的话无法记录 undo
blockquoteElement.insertAdjacentHTML("afterend", `<p data-block="0">${Constants.ZWSP}<wbr>\n</p>`);
setRangeByWbr(vditor[vditor.currentMode].element, range);
processAfterRender(vditor);
event.preventDefault();
return true;
}
// 需添加零宽字符,否则的话无法记录 undo
blockquoteElement.insertAdjacentHTML("afterend", `<p data-block="0">${Constants.ZWSP}<wbr>\n</p>`);
setRangeByWbr(vditor[vditor.currentMode].element, range);
execAfterRender(vditor);
event.preventDefault();
return true;
}
}
const blockElement = hasClosestBlock(startContainer);
Expand Down

0 comments on commit 6e5c354

Please sign in to comment.