From 5a396a5ae0a2bdd6e2b39d70e07f07a42e1f88d0 Mon Sep 17 00:00:00 2001 From: Dario Solera Date: Mon, 14 Dec 2009 18:07:56 +0000 Subject: [PATCH] Improved handling of header anchors whose main content starts/ends with a space. --- AssemblyVersion.cs | 4 ++-- Core/Formatter.cs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index cfe260b..c6afe44 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.1.441")] -[assembly: AssemblyFileVersion("3.0.1.441")] +[assembly: AssemblyVersion("3.0.1.442")] +[assembly: AssemblyFileVersion("3.0.1.442")] diff --git a/Core/Formatter.cs b/Core/Formatter.cs index 8693eb4..06b4a0f 100644 --- a/Core/Formatter.cs +++ b/Core/Formatter.cs @@ -2078,6 +2078,10 @@ namespace ScrewTurn.Wiki { /// The string, usually a header (Hx). /// The anchor ID. public static string BuildHAnchor(string h) { + // Remove any extra spaces around the heading title: + // '=== Title ===' results in '' instead of '' + if(h != null) h = h.Trim(); + StringBuilder sb = new StringBuilder(StripWikiMarkup(h)); sb.Replace(" ", "_"); sb.Replace(".", "");