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
|
@ -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