Editormd



Supports npm, GitHub, WordPress, Deno, and more. Largest network and best performance among all CDNs. Serving more than 80 billion requests per month. Built for production use.

  1. JsPanel.create( content: ' + '### Hello Editor.md!
  2. JavaScript gulp-replace - 30 examples found. These are the top rated real world JavaScript examples of gulp-replace.default extracted from open source projects. You can rate examples to help us.
  3. Download Poeta En La Cárcel - VJ Romero on komodenpa13.myddns.me.

1. Effect display

Database data:

After seeing the effect, if we can meet our needs, then we will go on!

2.springboot framework creates various packages

one pom.xml rely on

2. Create config, controller, entity, mapper, service and other packages in the same level directory of the startup class. As shown in the figure:

three application.yml And application-dev.yml configuration file

4. Create the mapping folder under Resources folder, and copy the rich text editor folder editormd to resources.

5. Configure static resource mapping class and Article layer package class

config folder to create WebMvcConfig configuration class. Purpose: static resources can be accessed.

Creating Article entity class under entity package

Create the ArticleController class under the controller package and the ArticleService interface under the service package, service.impl Creating the ArticleServiceImpl class under the package

Editormd cdn

Start class add @ mapperscan(“ com.dzb.mybatiseditor . mapper ')

3. The display page shows the details

The ArticleController class creates the article method, which returns the article.html Static page. (templates folder creation) article.html Page)

article.html

Insert picture

What we need to pay attention to:

add to editormd.css

The rich text editor takes id = 'article content' as the positioning point. When you need to change it, you need to change the ID coordinates here

When we upload pictures, the interface path for uploading pictures is as follows:

The article controller class creates a new file upload path method. Upload the image to the src peer directory upload folder.

Complete code

The publish and return home button of rich text editor can be customized

4. Data submitted to database

We can see in the figure above that when we click publish, the path to submit data to the server is / article/add/Article. When we need to change to our own path, we can change it here.

Writing Editor

We can see: when submitting data, it is mdEditorForm.submit(), which means that we need to add name = mdEditorForm to the form tag, which is a point to be noted. The name attribute is also required for the input fields of the title and author.

The path method addArticle is added to the ArticleController class. After adding successfully, the article data will be returned to the front end along with success.html Page (created under templates folder) success.html Page)

UserService class under service package:

service.impl The article serviceimpl class under the package

Class of ArticleMapper in mapper package

resources/mapping folder ArticleMapping.xml configuration file

Note: static files are self fetched. (in full code)

Database table:

5. Data echo

1. Return after adding successfully success.html At the same time, the page carries the article parameter.

Editor Md

If you want the string of markdown syntax to be displayed in markdown typesetting, you need to use the []] representation

success.html Full code:

Editor Md.min

start-up

Visiting address: http://localhost:8080/article

Data submission: click the Publish button

After submission, the data will be displayed on the web page: http://localhost:8080/article/addArticle (automatically jump after submitting)

Full code address: link: https://pan.baidu.com/s/1CWXofs56TqsmYjnje9IfqQ Extraction code: nnqh





Comments are closed.