bulgarian388
09-26-2009, 08:45 PM
Hi guys,
I have an ASP.NET MVC application which has an HTML filter applied to remove whitespace, ALL whitespace, one of which is the newline chars (\n).
It works perfectly, but I ran into an issue where I need to use <pre> to pull notes from the database which have multiple lines. Naturally, the filter strips all of the newlines from the notes and makes it into one LONG string.
So, my request is for someone to tell me how to alter the regex that removes newline chars so that it ignores all newlines chars inside of a <pre> tag.
Here's the current regex:
Source = new Regex(">\\r\\n<", RegexOptions.Compiled | RegexOptions.Multiline).Replace(Source, "><");
Source = new Regex("\\r\\n", RegexOptions.Compiled | RegexOptions.Multiline).Replace(Source, string.Empty);
Thanks in advance!
I have an ASP.NET MVC application which has an HTML filter applied to remove whitespace, ALL whitespace, one of which is the newline chars (\n).
It works perfectly, but I ran into an issue where I need to use <pre> to pull notes from the database which have multiple lines. Naturally, the filter strips all of the newlines from the notes and makes it into one LONG string.
So, my request is for someone to tell me how to alter the regex that removes newline chars so that it ignores all newlines chars inside of a <pre> tag.
Here's the current regex:
Source = new Regex(">\\r\\n<", RegexOptions.Compiled | RegexOptions.Multiline).Replace(Source, "><");
Source = new Regex("\\r\\n", RegexOptions.Compiled | RegexOptions.Multiline).Replace(Source, string.Empty);
Thanks in advance!