Fixed #469: worked around IE issue (spurious <p>&nbsp;</p> added).

This commit is contained in:
Dario Solera 2010-01-27 18:01:12 +00:00
parent c86aa2f318
commit 56e0ab0554
2 changed files with 10 additions and 10 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.1.463")] [assembly: AssemblyVersion("3.0.1.464")]
[assembly: AssemblyFileVersion("3.0.1.463")] [assembly: AssemblyFileVersion("3.0.1.464")]

View file

@ -94,6 +94,8 @@ namespace ScrewTurn.Wiki {
buffer.Replace("<STRONG>", "<b>"); buffer.Replace("<STRONG>", "<b>");
buffer.Replace("</strong>", "</b>"); buffer.Replace("</strong>", "</b>");
buffer.Replace("</STRONG>", "</b>"); buffer.Replace("</STRONG>", "</b>");
buffer.Replace("<P>", "<p>");
buffer.Replace("</P>", "</p>");
buffer.Replace("&amp;amp;", "&amp;"); buffer.Replace("&amp;amp;", "&amp;");
@ -101,6 +103,12 @@ namespace ScrewTurn.Wiki {
buffer.Replace("[", "&#91;"); buffer.Replace("[", "&#91;");
buffer.Replace("]", "&#93;"); buffer.Replace("]", "&#93;");
// #469: IE seems to randomly add this stuff
buffer.Replace("<p>&nbsp;</p>\r\n", "<br />");
buffer.Replace("<p>", "");
buffer.Replace("</p>", "");
// Temporarily replace <br /> in <pre> tags // Temporarily replace <br /> in <pre> tags
match = PreRegex.Match(buffer.ToString()); match = PreRegex.Match(buffer.ToString());
while(match.Success) { while(match.Success) {
@ -571,15 +579,7 @@ namespace ScrewTurn.Wiki {
match = BoxRegex.Match(buffer.ToString(), match.Index + 1); match = BoxRegex.Match(buffer.ToString(), match.Index + 1);
} }
buffer.Replace("<P>", "");
buffer.Replace("</P>", "<br />");
buffer.Replace("<p>", "");
buffer.Replace("</p>", "<br />");
// <br /> // <br />
//sb.Replace("<br /><br />", "\r\n\r\n");
//sb.Replace("\r\n<br />", "\r\n\r\n");
//sb.Replace("<br />", "{BR}\r\n");
buffer.Replace("<br />", "\r\n"); buffer.Replace("<br />", "\r\n");
// Fix line breaks in IE // Fix line breaks in IE