Improved handling of header anchors whose main content starts/ends with a space.
This commit is contained in:
parent
5b4f5e3df5
commit
5a396a5ae0
2 changed files with 6 additions and 2 deletions
|
@ -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")]
|
||||
|
|
|
@ -2078,6 +2078,10 @@ namespace ScrewTurn.Wiki {
|
|||
/// <param name="h">The string, usually a header (Hx).</param>
|
||||
/// <returns>The anchor ID.</returns>
|
||||
public static string BuildHAnchor(string h) {
|
||||
// Remove any extra spaces around the heading title:
|
||||
// '=== Title ===' results in '<a id="Title">' instead of '<a id="_Title_">'
|
||||
if(h != null) h = h.Trim();
|
||||
|
||||
StringBuilder sb = new StringBuilder(StripWikiMarkup(h));
|
||||
sb.Replace(" ", "_");
|
||||
sb.Replace(".", "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue