Top Related Projects
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
Super simple WYSIWYG editor
The next generation Javascript WYSIWYG HTML Editor.
Quick Overview
UEditor is a rich text web editor developed by Baidu. It's an open-source project that provides a powerful and customizable WYSIWYG editor for web applications, supporting various content types including text, images, videos, and more.
Pros
- Rich feature set, including image uploading, video embedding, and table creation
- Highly customizable with numerous plugins and configurations
- Cross-browser compatibility, supporting major browsers
- Active community and regular updates
Cons
- Large file size, which may impact page load times
- Steep learning curve for advanced customizations
- Some users report occasional stability issues
- Documentation is primarily in Chinese, which may be challenging for non-Chinese speakers
Code Examples
- Basic initialization:
UE.getEditor('editor');
This code initializes UEditor on an element with the ID 'editor'.
- Customizing toolbar buttons:
UE.getEditor('editor', {
toolbars: [
['fullscreen', 'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
'print', 'preview', 'searchreplace', 'drafts', 'help']
]
});
This example shows how to customize the toolbar buttons in UEditor.
- Getting and setting content:
var ue = UE.getEditor('editor');
// Set content
ue.setContent('Hello, UEditor!');
// Get content
var content = ue.getContent();
console.log(content);
This code demonstrates how to set and get the editor's content programmatically.
Getting Started
- Include UEditor files in your HTML:
<script type="text/javascript" src="ueditor.config.js"></script>
<script type="text/javascript" src="ueditor.all.min.js"></script>
- Add a container for the editor in your HTML:
<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
- Initialize the editor in your JavaScript:
UE.getEditor('editor');
- You can now use UEditor in your web application
Competitor Comparisons
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular
Pros of TinyMCE
- More active development with frequent updates and releases
- Extensive documentation and community support
- Better cross-browser compatibility and mobile support
Cons of TinyMCE
- Larger file size and potentially slower load times
- Steeper learning curve for advanced customization
- Commercial licensing required for some features
Code Comparison
TinyMCE initialization:
tinymce.init({
selector: 'textarea',
plugins: 'link image code',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code'
});
UEditor initialization:
var ue = UE.getEditor('editor', {
toolbars: [['fullscreen', 'source', 'undo', 'redo', 'bold', 'italic', 'underline']],
autoHeightEnabled: true,
autoFloatEnabled: true
});
Both editors offer similar basic functionality, but TinyMCE provides a more modular approach with plugins, while UEditor includes more features out-of-the-box. TinyMCE's initialization is generally simpler, but UEditor offers more granular control over toolbar options in the initial setup.
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Pros of CKEditor 5
- Modern architecture with a modular plugin system
- Extensive documentation and active community support
- Better cross-browser compatibility and mobile responsiveness
Cons of CKEditor 5
- Steeper learning curve for customization
- Larger file size and potentially higher resource usage
- More complex setup process for advanced features
Code Comparison
UEditor (HTML configuration):
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('editor');
</script>
CKEditor 5 (JavaScript initialization):
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
ClassicEditor
.create(document.querySelector('#editor'))
.then(editor => {
console.log('Editor was initialized', editor);
})
.catch(error => {
console.error(error);
});
The code comparison shows that UEditor uses a more traditional script-based setup, while CKEditor 5 employs a modern JavaScript module approach with promises for initialization.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Pros of Quill
- Modern, lightweight, and modular architecture
- Better cross-browser compatibility and mobile support
- Extensive API and customization options
Cons of Quill
- Smaller community and fewer ready-made plugins compared to UEditor
- Less support for legacy browsers and older systems
Code Comparison
UEditor (JavaScript):
UE.getEditor('editor').setContent('<p>Hello UEditor!</p>');
Quill (JavaScript):
var quill = new Quill('#editor');
quill.setContents([{ insert: 'Hello Quill!' }]);
Key Differences
- UEditor is primarily designed for Chinese users, while Quill has a more international focus
- Quill uses a modern, modular approach, making it easier to customize and extend
- UEditor has a larger collection of built-in features, while Quill relies more on plugins for advanced functionality
Use Cases
- UEditor: Better suited for projects requiring extensive out-of-the-box features and support for older systems
- Quill: Ideal for modern web applications prioritizing customization, performance, and mobile compatibility
Community and Support
- UEditor has a larger user base in China and more resources in Chinese
- Quill has a growing international community and better English documentation
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
Pros of medium-editor
- Lightweight and modular design, allowing for easy customization and extension
- Better cross-browser compatibility and mobile support
- More active development and community engagement
Cons of medium-editor
- Less feature-rich out of the box compared to UEditor
- May require more setup and configuration for advanced functionality
- Limited built-in support for non-English languages
Code Comparison
medium-editor:
var editor = new MediumEditor('.editable', {
toolbar: {
buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote']
},
placeholder: {
text: 'Type your text'
}
});
UEditor:
UE.getEditor('editor', {
toolbars: [
['fullscreen', 'source', 'undo', 'redo', 'bold', 'italic', 'underline']
],
initialContent: 'Type your text',
autoClearinitialContent: true
});
The code snippets demonstrate the initialization process for both editors. medium-editor offers a more concise and modern approach, while UEditor provides a more comprehensive set of options out of the box. medium-editor's configuration is more focused on specific features, whereas UEditor's setup includes a wider range of toolbar options by default.
Super simple WYSIWYG editor
Pros of Summernote
- Lightweight and easy to integrate with modern web frameworks
- More active development and community support
- Better cross-browser compatibility and mobile responsiveness
Cons of Summernote
- Less feature-rich compared to UEditor's extensive functionality
- Limited support for complex document structures and layouts
Code Comparison
UEditor initialization:
UE.getEditor('editor', {
toolbars: [['fullscreen', 'source', 'undo', 'redo']],
autoHeightEnabled: true,
autoFloatEnabled: true
});
Summernote initialization:
$('#summernote').summernote({
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']]
],
height: 300
});
Both editors offer customizable toolbars and configuration options. UEditor provides more advanced features out of the box, while Summernote focuses on simplicity and ease of use. UEditor's initialization typically requires more configuration for complex setups, whereas Summernote's initialization is more straightforward for basic use cases.
The next generation Javascript WYSIWYG HTML Editor.
Pros of wysiwyg-editor
- More modern and actively maintained, with frequent updates
- Extensive documentation and better community support
- Cross-browser compatibility and mobile-friendly design
Cons of wysiwyg-editor
- Commercial product with licensing fees, unlike the open-source ueditor
- Steeper learning curve for customization compared to ueditor
- Larger file size and potentially higher resource usage
Code Comparison
wysiwyg-editor initialization:
new FroalaEditor('#editor', {
toolbarButtons: ['bold', 'italic', 'underline']
});
ueditor initialization:
UE.getEditor('editor', {
toolbars: [['bold', 'italic', 'underline']]
});
Both editors allow for customization of toolbar buttons, but wysiwyg-editor uses a more modern JavaScript approach, while ueditor relies on a more traditional configuration object.
wysiwyg-editor offers a cleaner API and more flexibility in terms of customization and extension. However, ueditor may be easier to set up quickly for basic use cases, especially for developers familiar with older JavaScript patterns.
Overall, wysiwyg-editor is better suited for modern web applications with a focus on user experience and extensibility, while ueditor might be preferred for simpler projects or those with legacy requirements.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Get Started
é´äºç®å ISSUE è¾å¤èç»´æ¤æ¶é´è¾å°ï¼ä¸å¨è¿è¡åç»ççæ¬æ´æ°ï¼ç®åææ¶å ³é ISSUEï¼è¥ç¤¾åºæ人è·è¿ï¼æ¬¢è¿åæ们èç³»ãéå¤çé®é¢ï¼è¯·åé 常è§é®é¢ç FAQ Wikiã
éè¦å®å ¨éåï¼
- commons-fileupload-1.3.1.jar åå¨æ¼æ´å¯è½ä¼å¯¼è´ ddosï¼æºä»£ç ä¸å·²ç»ä¿®æ¹ï¼ä½¿ç¨èçæ¬çç¨æ·ï¼å¼ºçæ¨èå级 commons-fileupload.jar è³ææ°çæ¬ãï¼2018-04-09ï¼.
- UEditor ææä¾çææå端代ç é½ä» 为 DEMO ä½ç¨ï¼åä¸å¯ç´æ¥ä½¿ç¨å°ç产ç¯å¢ä¸ï¼ç®åå·²ç¥ php ç代ç ä¼åå¨ ssrf åæ件å å«æ¼æ´ï¼å æ¤ä¸åæä¾ã
ueditorå¯ææ¬ç¼è¾å¨ä»ç»
UEditoræ¯ç±ç¾åº¦webå端ç åé¨å¼åæè§å³æå¾å¯ææ¬webç¼è¾å¨ï¼å ·æè½»éï¼å¯å®å¶ï¼æ³¨éç¨æ·ä½éªçç¹ç¹ï¼å¼æºåºäºMITåè®®ï¼å 许èªç±ä½¿ç¨åä¿®æ¹ä»£ç ã
1 å ¥é¨é¨ç½²åä½éª
1.1 ä¸è½½ç¼è¾å¨
git clone
ä»åºnpm install
å®è£ ä¾èµï¼å¦æ没æå®è£ grunt , 请å å¨å ¨å±å®è£ gruntï¼- å¨ç»ç«¯æ§è¡
grunt default
1.2 å建demoæ件
解åä¸è½½çå ï¼å¨è§£ååçç®å½å建demo.htmlæ件ï¼å¡«å ¥ä¸é¢çhtml代ç
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>ueditor demo</title>
</head>
<body>
<!-- å è½½ç¼è¾å¨çå®¹å¨ -->
<script id="container" name="content" type="text/plain">è¿éåä½ çåå§åå
容</script>
<!-- é
ç½®æ件 -->
<script type="text/javascript" src="ueditor.config.js"></script>
<!-- ç¼è¾å¨æºç æ件 -->
<script type="text/javascript" src="ueditor.all.js"></script>
<!-- å®ä¾åç¼è¾å¨ -->
<script type="text/javascript">
var ue = UE.getEditor('container');
</script>
</body>
</html>
1.3 å¨æµè§å¨æå¼demo.html
å¦æçå°äºä¸é¢è¿æ ·çç¼è¾å¨ï¼æåä½ ï¼å次é¨ç½²æåï¼
1.4 ä¼ å ¥èªå®ä¹çåæ°
ç¼è¾å¨æå¾å¤å¯èªå®ä¹çåæ°é¡¹ï¼å¨å®ä¾åçæ¶åå¯ä»¥ä¼ å ¥ç»ç¼è¾å¨ï¼
var ue = UE.getEditor('container', {
autoHeight: false
});
é 置项ä¹å¯ä»¥éè¿ueditor.config.jsæ件修æ¹ï¼å ·ä½çé ç½®æ¹æ³è¯·ç[å端é 置项说æ](http://fex.baidu.com/ueditor/#start-config1.4 å端é 置项说æ.md)
1.5 设置å读åç¼è¾å¨çå 容
égetContentåsetContentæ¹æ³å¯ä»¥è®¾ç½®å读åç¼è¾å¨çå 容
var ue = UE.getEditor();
//对ç¼è¾å¨çæä½æ好å¨ç¼è¾å¨readyä¹ååå
ue.ready(function(){
//设置ç¼è¾å¨çå
容
ue.setContent('hello');
//è·åhtmlå
容ï¼è¿å: <p>hello</p>
var html = ue.getContent();
//è·å纯ææ¬å
容ï¼è¿å: hello
var txt = ue.getContentTxt();
});
ueditorçæ´å¤API请çAPI ææ¡£
1.6 dev-1.5.0 çæ¬äºæ¬¡å¼åèªå®ä¹æ件注æäºé¡¹
dev-1.5.0ç对äºæ件çå è½½é»è¾è¿è¡äºè°æ´ï¼ä½å®ç½å¯¹åºçäºæ¬¡å¼ååè½ææ¡£æªå¯¹ç¸åºè°æ´ååºå¼åç»è说æï¼ç°è¡¥å å¦ä¸ï¼
é¤è¿è¡åæé ç½®å¤ï¼è¿éå¨å®ä¾åueditorç¼è¾å¨æ¶å¨ toolbars åæ°æ°ç»ä¸ï¼å å ¥èªå®ä¹æ件ç uinameï¼å¹¶ä¸æ³¨æuinameå¿ é¡»å°åï¼æ¹å¯æ£ç¡®å è½½èªå®ä¹æ件ã
2 详ç»ææ¡£
ueditor å®ç½ï¼http://ueditor.baidu.com
ueditor API ææ¡£ï¼http://ueditor.baidu.com/doc
ueditor github å°åï¼http://github.com/fex-team/ueditor
ueditor 第ä¸æ¹æä»¶è´¡ç® wiki : 第ä¸æ¹æ件贡ç®è§è
ueditor è´¡ç®ä»£ç è§èï¼javascriptï¼ï¼ javascriptè§è
3 第ä¸æ¹è´¡ç®
ueditor for nodejs åèhttps://github.com/netpi/ueditor
4 èç³»æ们
emailï¼ueditor@baidu.com
issueï¼github issue
Top Related Projects
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
Super simple WYSIWYG editor
The next generation Javascript WYSIWYG HTML Editor.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot