[Announcement] a bug in the Code coloring Function

Source: Internet
Author: User
First of all, I am very grateful to Mu yehu for discovering this bug. It has been around for so long and I have not found it!
BUG:

When inserting Code If the Code contains code in the form of a ["B"], the Asp.net process will occupy 100% of the CPU. If it is IIS 6, it will cause IIS to restart the process, the error "Service unavailable" is displayed. The previous "Service unavailable" in the blog may be caused by this bug.

Cause:

It is caused by a regular expression that converts spaces to "& nbsp. The Regular Expression Code is as follows:

Public Static String Replacespace ( String Content)

{

String Findstr = " (? <Fore> (? :(? : [^ <]) * (? : <(? :! --(? :(? : [^-]) * (? :(? = -->) |-) * -- | (? : [^>]) +)> )?) *) [] (? <Back> (? :(? : [^ <]) * (? : <(? :! --(? :(? : [^-]) * (? :(? = -->) |-) * -- | (? : [^>]) +)> )?) *) " ;

String Replacestr = " $ {Fore} & nbsp; $ {back} " ;

String Targetstr = System. Text. regularexpressions. RegEx. Replace (content, findstr, replacestr, system. Text. regularexpressions. regexoptions. ignorecase );

Return Targetstr;

}


This regular expression is provided by a friend. The main function is to convert spaces in the non-htmt mark of the string into "& nbsp;". Currently, I have not found any problems in this regular expression, please familiarize yourself with regular expressions.

Temporary solution: disable this regular expression. This will affect the space display before the code line.

In addition, two options are added to the Code coloring function: 1. Whether to display the row number. 2. whether to use code folding.

Note: please pay attention to this issue when using cnblogs dottext 1.0 Beta 2.

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.