We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wysiwyg
ir
段落输入或无序和有序列表连续输入回车后,控制台会报错Uncaught TypeError: Cannot read properties of null (reading 'replace')
1. sdsdf 2. ds 3. fdf 4. s 5. f
报错对应的代码是这里fixbrowserBehavior.ts
// https://github.com/Vanessa219/vditor/issues/361 代码块后输入中文 export const fixCJKPosition = (range: Range, vditor: IVditor, event: KeyboardEvent) => { if (event.key === "Enter" || event.key === "Tab" || event.key === "Backspace" || event.key.indexOf("Arrow") > -1 || isCtrl(event) || event.key === "Escape" || event.shiftKey || event.altKey) { return; } 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, '');//**这个地方报错,这个地方不应该是pLiElement.childNodes[0].nodeValue?如果不是,也该判断一下xxx.nodeValue是否存在或是否为null** const zwspNode = document.createTextNode(Constants.ZWSP); range.insertNode(zwspNode); range.setStartAfter(zwspNode); } };
不要报错
The text was updated successfully, but these errors were encountered:
我也遇到了,现在的解决方法是加了一层判断
Sorry, something went wrong.
🐛 fix #1343
fee8b4e
🐛 #1343
48b4cd9
Vanessa219
No branches or pull requests
编辑模式
wysiwyg
所见即所得模式ir
即时渲染模式描述问题
段落输入或无序和有序列表连续输入回车后,控制台会报错Uncaught TypeError: Cannot read properties of null (reading 'replace')
报错对应的代码是这里fixbrowserBehavior.ts
期待的结果
不要报错
版本信息
vivaldi,chrome,360
其他信息
The text was updated successfully, but these errors were encountered: