基于 JS 的 HTML/XML 类型内容的 Diff/Patch

发布于 2024-12-11 11:51:56 字数 322 浏览 0 评论 0原文

我已经在一个具有纯文本内容协作编辑功能的应用程序上工作了一段时间。我一直把添加简单的富文本支持(即粗体、斜体、下划线、项目符号和编号列表)放在次要位置,但一直无法找到用 JavaScript 编写的算法。

我知道 Google 托管的 diff-match-patch 库对结构化内容有一些建议,但我希望找到已经编写的内容(是的,我知道,听起来很懒)。

我找到了一个 JS diff 库,jsdifflib,但我不确定它是否支持结构化内容(而且它也没有补丁库,对我来说,对于结构化内容来说,补丁库似乎比 diff 库更重要,或者它是) ?)DaisyDiff 看起来不错,但是当然没有 JS 版本。

I've been working for a while on an application that has collaborative editing of plain text content. I have always had it on the back burner to add simple Rich Text support (namely bold, italic, underline, bulleted and numbered lists) but have not been able to find an algorithm that is written in JavaScript.

I know that the Google hosted diff-match-patch library has some suggestions for structured content, but I was hoping to find something that has already been written (yeah, I know, sounds lazy).

I have found one JS diff library, jsdifflib, but I'm unsure if it supports structured content (and it also doesn't have a patch library, which to me almost seems more important with structured content then the diff library, or is it?) DaisyDiff looks nice, but of course, there is no JS version.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文