new line break short description

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
hey, when i making short description

if im writing
1
2
3
4
5


it will show the short description like this

12345

example



after saving
4 years ago
Yes that’s how it works. Short description is not meant to be formatted text
4 years ago
ASCII code of new line in textarea is '\r\n'. But in HTML new line means <br />. So in your case, you have to code something like this while printing.

@{ 
    string[] stringSeparators = new string[] { "\r\n" };

    string[] lines = Model.ShortDescription.Split(stringSeparators, StringSplitOptions.None);
    foreach (string s in lines)
    {
        //print per paragraph/line
    }
}
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.