The webwork tag can display line breaks and other input formats on the page.

Source: Internet
Author: User

 

When a program is developed, the <WW: Property> label must be used to display the data entered in the background at the front end, but the displayed content is accumulated together, the entered line feed information cannot be displayed.

After research, it is found that the <WW: Property> label cannot display the line feed information. You must set the attribute to escape = "false", and then escape the output content in HTML, you can display line breaks and other information.

My code is as follows:

1. Front-end display: <WW: property value = "faqform. Content" Escape = "false"/>

2. faqform. setcontent (stringutils. tohtml (faqform. getcontent ()));

The tohtml method is as follows:

Public static string tohtml (string Str ){
If (STR = NULL)
STR = "";
String html = STR;
Html = Replace (HTML, "&", "& amp ;");
Html = Replace (HTML, "<", "& lt ;");
Html = Replace (HTML, ">", "& gt ;");
Html = Replace (HTML, "/R/N", "/N ");
Html = Replace (HTML, "/N", "<br> ");
Html = Replace (HTML, "/T ","");
Html = Replace (HTML, "", "& nbsp ;");
Html = Replace (HTML, "/" "," & quot ;");
Return HTML;
}

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.