如何实施Google文档(如文本编辑器)? [英] How to implement Google doc like text editor?

查看:160
本文介绍了如何实施Google文档(如文本编辑器)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打开了一个google文档,似乎google doc不是一个简单的文本区域....似乎这是一个自定义的东西....有什么图书馆做这样的事情吗?

I opened a google doc, it seems that the google doc is not a simple text area .... it seems that this is a customize stuff.... is there any library for doing that kind of things?

推荐答案

大多数编辑使用 contentEditable 属性。只需在任何HTML元素上设置即可在现代用户代理中进行编辑,复制和粘贴,拼写检查,格式化等。

Most editors use the contentEditable property. Simply setting it on any HTML element enables editing, copy&paste, spell checking, formatting etc. in modern user agents.

但是,Google文档使用contentEditable。相反,他们在JavaScript中实现了自己的呈现引擎。除非你计划在google文档的规模上的项目(即你至少有3个人愿意在渲染引擎上全职工作),contentEditable是要走的路。

However, google docs specifically does not use contentEditable. Instead, they implemented their own rendering engine in JavaScript. Unless you plan a project on the scale of google docs (i.e. you have at least, say, 3 people willing to work full-time on the rendering engine), contentEditable is the way to go.

这篇关于如何实施Google文档(如文本编辑器)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆