Skip to content

Commit 91445ab

Browse files
committed
Modify handling of inline seealso tags
1 parent e0cedd1 commit 91445ab

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/DendroDocs.Shared/Descriptions/DocumentationCommentsDescription.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private void ProcessBlockContent(StringBuilder stringBuilder, XElement element)
272272
}
273273
}
274274

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

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

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

287-
return this.SeeAlsos[key];
286+
if (string.IsNullOrWhiteSpace(value))
287+
{
288+
this.SeeAlsos[key] = key;
289+
contents.Append(key);
290+
}
291+
else
292+
{
293+
this.SeeAlsos[key] = value;
294+
}
288295
}
289296

290297
private static string StripIDPrefix(string? value)

0 commit comments

Comments
 (0)