From bd65c84133c39435f23f4f93712a0737f9436fba Mon Sep 17 00:00:00 2001 From: Dario Solera Date: Mon, 12 Oct 2009 15:34:55 +0000 Subject: [PATCH] Fixed and closed #364: all HTML comments are stripped away except for ones inside PRE tags. --- AssemblyVersion.cs | 4 ++-- Core/Formatter.cs | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index cd9e1a8..5ac5f6b 100644 --- a/AssemblyVersion.cs +++ b/AssemblyVersion.cs @@ -16,5 +16,5 @@ using System.Reflection; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.0.347")] -[assembly: AssemblyFileVersion("3.0.0.347")] +[assembly: AssemblyVersion("3.0.0.348")] +[assembly: AssemblyFileVersion("3.0.0.348")] diff --git a/Core/Formatter.cs b/Core/Formatter.cs index bc1f3b5..5a6b951 100644 --- a/Core/Formatter.cs +++ b/Core/Formatter.cs @@ -150,13 +150,6 @@ namespace ScrewTurn.Wiki { 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 sb.Replace("", ""); sb.Replace("", ""); @@ -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 tags if(!bareBones) { sb.Replace("", "");