Fixed and closed #364: all HTML comments are stripped away except for ones inside PRE tags.

This commit is contained in:
Dario Solera 2009-10-12 15:34:55 +00:00
parent 99ef640d48
commit bd65c84133
2 changed files with 11 additions and 9 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.0.347")] [assembly: AssemblyVersion("3.0.0.348")]
[assembly: AssemblyFileVersion("3.0.0.347")] [assembly: AssemblyFileVersion("3.0.0.348")]

View file

@ -150,13 +150,6 @@ namespace ScrewTurn.Wiki {
match = JavascriptRegex.Match(sb.ToString(), match.Index + 1); match = JavascriptRegex.Match(sb.ToString(), match.Index + 1);
} }
// Strip out all comments
//match = CommentRegex.Match(sb.ToString());
//while(match.Success) {
// sb.Remove(match.Index, match.Length);
// match = CommentRegex.Match(sb.ToString(), match.Index + 1);
//}
// Remove empty NoWiki and NoBr tags // Remove empty NoWiki and NoBr tags
sb.Replace("<nowiki></nowiki>", ""); sb.Replace("<nowiki></nowiki>", "");
sb.Replace("<nobr></nobr>", ""); sb.Replace("<nobr></nobr>", "");
@ -834,6 +827,15 @@ namespace ScrewTurn.Wiki {
} }
} }
// Strip out all comments
if(!bareBones) {
match = CommentRegex.Match(sb.ToString());
while(match.Success) {
sb.Remove(match.Index, match.Length);
match = CommentRegex.Match(sb.ToString(), match.Index + 1);
}
}
// Remove <nowiki> tags // Remove <nowiki> tags
if(!bareBones) { if(!bareBones) {
sb.Replace("<nowiki>", ""); sb.Replace("<nowiki>", "");