Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

fex-team/ueditor

Repository files navigation

Get Started

In view of the fact that there are more ISSUEs and less maintenance time at present, and the subsequent version update is in progress, ISSUE is temporarily closed. If anyone in the community follows up, please contact us. For repeated questions, see the FAQ FAQ Wiki

Important safety notices:

  1. The commons-fileupload-1.3.1. jar has a vulnerability that may lead to ddos. The source code has been modified. Users who use the old version are strongly recommended to upgrade commons-fileupload.jar to the latest version. (2018-04-09).
  2. All back-end codes provided by UEditor are only used for DEMO, and must not be directly used in the production environment. Currently, PHP codes are known to have ssrf and file inclusion vulnerabilities, so they are no longer provided.

Introduction to ueeditor rich text editor

UEditor is a WYSIWYG rich text web editor developed by Baidu web front-end research and development department. It is lightweight, customizable, and focuses on user experience. The open source is based on MIT protocol, allowing free use and modification of code.

1 Getting Started Deployment and Experience

1.1 Download editor

  1. git clone Warehouse
  2. npm install Installation dependency (if grunt is not installed, please install grunt globally first)
  3. Executed at the terminal grunt default

1.2 Creating a Demo File

Unzip the downloaded package, create the demo.html file in the unzipped directory, and fill in the following html code

 <! DOCTYPE HTML >
 < html  lang =" en-US " >
 < head >
	 < meta  charset =" UTF-8 " >
	 < title > ueditor demo </ title >
 </ head >
 < body >
	 <!--  Load the editor's container -->
	 < script  id =" container " name =" content " type =" text/plain " > Write your initialization content here </ script >
	 <!--  Profile -->
	 < script  type =" text/javascript " src =" ueditor.config.js " > </ script >
	 <!--  Editor source code file -->
	 < script  type =" text/javascript " src =" ueditor.all.js " > </ script >
	 <!--  Instantiation Editor -->
	 < script  type =" text/javascript " >
	     var  ue  =  UE . getEditor ( 'container' ) ;
	 </ script >
 </ body >
 </ html >

1.3 Open demo.html in the browser

If you see the following editor, congratulations, the initial deployment is successful!

 Deployment succeeded

1.4 Incoming user-defined parameters

The editor has many customizable parameter items that can be passed to the editor during instantiation:

 var  ue  =  UE . getEditor ( 'container' ,  {
     autoHeight : false
 } ) ;

Configuration items can also be modified through the ueditor.config.js file. For specific configuration methods, see [Description of Front end Configuration Items]( http://fex.baidu.com/ueditor/#start -config1.4 Front end configuration item description. md)

1.5 Setting and Reading Editor Content

The contents of the editor can be set and read through the getContent and setContent methods

 var  ue  =  UE . getEditor ( ) ;
 //It is better to operate the editor after the editor is ready
 ue . ready ( function ( ) {
     //Set the contents of the editor
     ue . setContent ( 'hello' ) ;
     //Get the html content and return:<p>hello</p>
     var  html  =  ue . getContent ( ) ;
     //Get plain text content and return: hello
     var  txt  =  ue . getContentTxt ( ) ;
 } ) ;

For more APIs of ueditor, see API documentation

1.6 dev-1.5.0 Customization plug-in precautions

The dev-1.5.0 version has adjusted the plug-in loading logic, but the corresponding Secondary development function document The development details of corresponding adjustments are not explained, and are supplemented as follows:

In addition to the original configuration, you also need to add the uiname of the user-defined plug-in in the toolbars parameter array when instantiating the ueeditor editor. Note that the uiname must be lowercase to load the user-defined plug-in correctly.

2 Detailed documents

Official website of ueditor: http://ueditor.baidu.com

Ueeditor API documentation: http://ueditor.baidu.com/doc

Ueditor github Address: http://github.com/fex-team/ueditor

Ueditor third-party plug-in contribution wiki: Third party plug-in contribution specification

Ueditor contribution code specification (javascript): Javascript specification

3 Third party contribution

Ueeditor for nodejs Reference https://github.com/netpi/ueditor

4 Contact us

email: ueditor@baidu.com

issue: github issue