What does "<pre>" and "_pre_" respectively mean in the following code The code is at:
http://west-wind.com/weblog/posts/1499.aspx
public static string DisplayMemoEncoded(string Text)
{
bool PreTag = false;
if (Text.IndexOf("<pre>") > -1)
{
Text = Text.Replace("<pre>","__pre__");
Text = Text.Replace("</pre>","__/pre__");
PreTag = true;
}
// *** fix up line breaks into <br><p>
Text = Westwind.Tools.wwUtils.DisplayMemo( HttpUtility.HtmlEncode(Text) );
if (PreTag)
{
Text = Text.Replace("__pre__","<pre>");
Text = Text.Replace("__/pre__","</pre>");
}
return Text;
}

"<pre>" and "_pre_"?
Omar Fawzi
>> __pre__ is what the user enterd so convert it to html tag <pre> and vis versa
Not exactly. The user enters <pre> & </pre> as part of normal HTML. For some reason, the developer does not want <pre> processed by DisplayMemo(), so he temporarily removes them, and then later replaces them.
MFZ
Mindy Riddick
<pre> is html tag that defines preformatted text
__pre__ is what the user enterd so convert it to html tag <pre> and vis versa
to display text input by users properly in HTML
Nikhil - MSFT
OK, now that I've read the blog you cited, I now understand the method.
Overall, it takes a string and adds <br> at the appropriate spots. (That's DisplayMemo).
DisplayMemoEncoded add a call to HttpUtility.HtmlEncode before calling DisplayMemo. This translates < and > to < and >. The problem is, if there is an embed HTML section is the text (surrounded by <pre> ... </pre>) those < and >s will converted also, and suddenly, it's no longer a preformmated section, so he changes the <pre> tag to something that won't be affected by HttpUtility.HtmlEncode, and then later changes it back.