Re: keep the new line character in SQL server text
From: Nicole Calinoiu (nicolec_at_somewhere.net)
Date: 05/21/04
- Next message: Aaron Bertrand - MVP: "Re: Dynamic SQL"
- Previous message: Aaron Bertrand - MVP: "Re: Logging within User_Defined Functions (UDF)"
- In reply to: Aaron Bertrand - MVP: "Re: keep the new line character in SQL server text"
- Next in thread: Aaron Bertrand - MVP: "Re: keep the new line character in SQL server text"
- Reply: Aaron Bertrand - MVP: "Re: keep the new line character in SQL server text"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 21 May 2004 11:09:45 -0400
Unfortunately, that's not quite so. If it were, it would be a very
convenient way to avoid HTML and script injections. (Which, incidentally, I
didn't mention just because it seemed like neither the place nor the time...
<g>)
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:eZgI58zPEHA.832@TK2MSFTNGP09.phx.gbl...
> Just an aside, if there is HTML content in the text (e.g. <b>text</b>),
> the
> <pre> tag will show the tags instead of the intent. Just something to
> consider; I mainly use this for HTML content, so I prefer to replace the
> white space cr+lf with HTML cr+lf.
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
>
>
> "Nicole Calinoiu" <nicolec@somewhere.net> wrote in message
> news:e8YKpnzPEHA.3524@TK2MSFTNGP09.phx.gbl...
>> Caspy,
>>
>> This is very unlikely to have anything to do with SQL Server or your data
>> storage. Instead, it's most likely the result of HTML display rules,
> which
>> preclude the rendering of extended white space. To conserve the
>> paragraph
>> formatting, you can wrap the text in a PRE element. e.g.:
>>
>> <pre>Your text goes here with
>>
>> white space
>>
>> preserved at rendering.</pre>
>>
>> See http://www.w3.org/TR/html4/struct/text.html#edef-PRE for the official
>> word on the PRE element.
>>
>> HTH,
>> Nicole
>>
>> "Caspy" <caspases@yahoo.com> wrote in message
>> news:OsP8KOzPEHA.628@TK2MSFTNGP11.phx.gbl...
>> >I am developing a web site for a discussion forum with SQL server 2000
>> >as
>> > back end data storage. The post messages are save as 'text' in
>> > database.
>> > Messages are extracted from a text box. In the text box, poster can
>> > have
>> > some format like new paragraphs to make post look better. However, the
>> > message from the SQL server lost all new line characters. each message
> is
>> > long string with any line break. How to keep the paragraph format?
>> >
>> > thanks,
>> >
>> > --Caspy
>> >
>> >
>>
>>
>
>
- Next message: Aaron Bertrand - MVP: "Re: Dynamic SQL"
- Previous message: Aaron Bertrand - MVP: "Re: Logging within User_Defined Functions (UDF)"
- In reply to: Aaron Bertrand - MVP: "Re: keep the new line character in SQL server text"
- Next in thread: Aaron Bertrand - MVP: "Re: keep the new line character in SQL server text"
- Reply: Aaron Bertrand - MVP: "Re: keep the new line character in SQL server text"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|