Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 21, 2022
2 parents b8889d8 + ed9e0da commit 71f8d05
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ts/util/fixBrowserBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const fixCJKPosition = (range: Range, vditor: IVditor, event: KeyboardEve
const pLiElement = hasClosestByMatchTag(range.startContainer, "P") ||
hasClosestByMatchTag(range.startContainer, "LI");
if (pLiElement && getSelectPosition(pLiElement, vditor[vditor.currentMode].element, range).start === 0) {

// https://github.com/Vanessa219/vditor/issues/1289 WKWebView切换输入法产生六分之一空格,造成光标错位
pLiElement.nodeValue = pLiElement.nodeValue.replace(/\u2006/g, '');

const zwspNode = document.createTextNode(Constants.ZWSP);
range.insertNode(zwspNode);
range.setStartAfter(zwspNode);
Expand Down

0 comments on commit 71f8d05

Please sign in to comment.