Baidu editor ueditor foreground code highlighting cannot automatically wrap

Source: Internet
Author: User

Baidu editor ueditor foreground code highlighting cannot automatically wrap

In the past two days, the website has successfully installed and integrated the Baidu editor ueditor, which is quite good, but has encountered some minor problems.

Problem description:

 

Insert the code highlighted in the content. The background editor can automatically wrap the text. However, after the text is published, you can view it on the foreground and find that the Code cannot wrap automatically, which is beyond the boundaries of the Content Page, not beautiful, although the replication can be complete.

 

Solution:

 

Find the css file/e/data/ecmseditor/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css displayed in the highlighted code.

 

The specific path is modified according to your ueditor.

 

Find

 

The Code is as follows:

. Syntaxhighlighter {width: 100%! Important; margin:. 3em 0. 3em 0! Important; position: relative! Important; overflow: auto! Important; background-color: # f5f5f5! Important; border: 1px solid # ccc! Important;

 

 

Change

 

The Code is as follows:

. Syntaxhighlighter {width: 100%! Important; margin:. 3em 0. 3em 0! Important; position: relative! Important; overflow: auto! Important; background-color: # f5f5f5! Important; border: 1px solid # ccc! Important; word-break: break-all;

 

 

Add word-break: break-all;

 

Different ueditor versions may have different css statements, as long as the corresponding position is added with this forced line feed.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.