Skip to content

Commit

Permalink
Modify handling of inline seealso tags
Browse files Browse the repository at this point in the history
  • Loading branch information
eNeRGy164 committed Sep 16, 2024
1 parent e0cedd1 commit 91445ab
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private void ProcessBlockContent(StringBuilder stringBuilder, XElement element)
}
}

private string ProcessSeeAlsoTag(StringBuilder contents, XElement element, bool removeNewLines)
private void ProcessSeeAlsoTag(StringBuilder contents, XElement element, bool removeNewLines)
{
var key = StripIDPrefix(element.Attribute(Attribute.CRef)?.Value);

Expand All @@ -282,9 +282,16 @@ private string ProcessSeeAlsoTag(StringBuilder contents, XElement element, bool

// Get the contents added to the StringBuilder in the ProcessInlineContent method
var value = contents.ToString(previousLength, contents.Length - previousLength);
this.SeeAlsos[key] = !string.IsNullOrEmpty(value) ? value : key;

return this.SeeAlsos[key];
if (string.IsNullOrWhiteSpace(value))
{
this.SeeAlsos[key] = key;
contents.Append(key);
}
else
{
this.SeeAlsos[key] = value;
}
}

private static string StripIDPrefix(string? value)
Expand Down

0 comments on commit 91445ab

Please sign in to comment.