适合现代Web应用的富文本编辑器:wysihtml
wysihtml是一个可扩展基于HTML5技术的开源富文本编辑器。这是一个独立的JS库,不需要类似 jQuery的框架支持。
示例
- Project page with simple demo: http://wysihtml.com
- Minimal demo: http://voog.github.com/wysihtml/examples/simple.html
- Advanced demo: http://voog.github.com/wysihtml/examples/advanced.html
- Editable GitHub page: http://voog.github.com/wysihtml
- Or try it on a working app: http://voog.com
特性
- Auto linking of urls as-you-type.
- Generates valid and semantic HTML5 markup (no
<font>
tags). - Can use class-names instead of inline styles.
- Unifies line-break handling across browsers (hitting enter will create
<br>
instead of<p>
or<div>
). - Auto-parses content inserted via copy & paste (from Word, Powerpoint, PDF, other web pages, etc.).
- Converts invalid or unknown html tags into valid/similar tags.
- Source code view for users with HTML skills.
- Uses sandboxed iframes in order to prevent identity theft through XSS.
- Editor inherits styles and attributes (
placeholder
,autofocus
, etc.) from original textarea (you only have to style one element). - Speech-input for Chrome.
Extended features not present in xing/wysihtml5:
- Can be used without iframe sandbox when initiated on
<div>
instead of<textarea>
. - Blocking of image drag drop in editable is removed.
- Table insertion management and cell merging commands.
- Improved parser with options to: unwrap tag instead of remove, keep defined styles, complex object type definitions for allowing elements.
- Ability to add uneditable area inside editor text flow (useful when building modules like video tools, advanced image editor etc).
- Improved formatblock handling.
- Ability for user to remove formating with only collapsed caret without having to select exactly whole text.
- Improved speed.
- Anchor creting and removing logic changed to more universal.
- Default build is without internal toolbar functions and build with
-toolbar
suffix contains default toolbar functions.
Browser Support
The rich text editing interface is supported in IE8+, FF 29+, Safari 4+, Safari on iOS 5+, Opera 12+ and Chrome.Graceful Degradation: Users with other browsers will see the textarea and are still able to write plain HTML by themselves.
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!