Skip to content
New issue

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

在mathml或者svg公式后边会失去光标定位 #5862

Open
xulig opened this issue May 15, 2024 · 4 comments
Open

在mathml或者svg公式后边会失去光标定位 #5862

xulig opened this issue May 15, 2024 · 4 comments

Comments

@xulig
Copy link

xulig commented May 15, 2024

bug 描述

在编辑器中插入一个mathml公式或者svg格式的公式后,在这个公式的后边就失去了光标的位置,光标无法固定到公式的后边,也无法插入东西,从后台插入空格可继续输入,但是,删除的时候公式和后边的第一个字符是绑定的会一起删除

你预期的样子是?

上边问题解决

系统和浏览器及版本号

  • 操作系统macos3.6.1 (22G313)
  • 浏览器和版本Chrome浏览器,版本 124.0.6367.201(正式版本) (x86_64)

wangEditor 版本

最新版

demo 能否复现该 bug ?

在线 demo

请尽量提供在线 demo (推荐以下网站),帮助我们最低成本复现 bug

最小成本的复现步骤

(请告诉我们,如何最快的复现该 bug)

  • 步骤一:在后台编辑html带入插入一个math公式,如:1+sin2θ
  • 步骤二:在公式的后边是空白的情况下,尝试继续输入文本,发现没法输入,就会发现bug
  • 步骤三
@cycleccc
Copy link

有更详细的代码和视频吗,slate 对 mathml 的支持可能不太好,首先可以确定的是 wangEditor 没有做 mathml 公式的扩展。

@xulig
Copy link
Author

xulig commented May 17, 2024

-.02.mp4

@cycleccc
Copy link

😯,awesome,还能这样用的, 虽然 mathml公式被强制渲染进了编辑区,但是这只是暂时的html改变,页面代码本质上没有改变。
wangEditor 的 输入需要经过 setHtml才能变为合法的代码(mathml不包含在wangEditor本体逻辑里)。
你可能需要的是一个 mathml扩展,有时间的话可以试试照着例子搓一个https://www.wangeditor.com/v5/development.html#%E5%9C%A8%E7%BC%96%E8%BE%91%E5%99%A8%E4%B8%AD%E6%B8%B2%E6%9F%93%E6%96%B0%E5%85%83%E7%B4%A0
或是网上也有类似的别人已经实现的数学公式扩展。

@cycleccc
Copy link

当然也可以等我实现一个,我已经对wangEditor本体fork发包了,最近会提交一些固有的bug(我在这提了很久了作者没空管😇)并发布修复版本,后续可能会支持这个mathml扩展🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants