Skip to content

Commit 1e5c8a9

Browse files
authored
Fix section title extraction logic in DocusaurusContentGenerator
.NET changed how Reverse works
1 parent 7ad8ecb commit 1e5c8a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DocusaurusExportPlugin/DocusaurusContentGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private string EscapeMdxSpecialChars(string content)
328328
// We may get more than one line so find the last one with a section title which will be
329329
// the closest to the span.
330330
string? title = sectionTitle.Value.Split(new[] { '\r', '\n' },
331-
StringSplitOptions.RemoveEmptyEntries).Reverse().FirstOrDefault(
331+
StringSplitOptions.RemoveEmptyEntries).AsEnumerable().Reverse().FirstOrDefault(
332332
t => t.Trim().Length > 2 && t[0] == '#');
333333

334334
if (title != null)
@@ -468,4 +468,4 @@ private void RecursiveCopy(string sourcePath, string destPath, ref int fileCount
468468
RecursiveCopy(folder, destPath + folder.Substring(sourcePath.Length + 1), ref fileCount);
469469
}
470470
}
471-
}
471+
}

0 commit comments

Comments
 (0)