Hugo Titles

This commit is contained in:
Mike Phares 2023-07-19 21:54:42 -07:00
parent 012cfcfafc
commit d6266139f8

View File

@ -815,7 +815,6 @@ internal static partial class HelperMarkdown
string? directory;
string[] segmentsA;
string[] segmentsB;
string[] segmentsC;
string relativeFile;
string segmentsALast;
string segmentsBFirst;
@ -845,10 +844,12 @@ internal static partial class HelperMarkdown
if (segmentsB.Length != 2)
continue;
segmentsBFirst = segmentsB.First();
segmentsC = segmentsA.First().Split('[');
if (!segmentsBFirst.EndsWith(".md"))
file = Path.GetFullPath(Path.Combine(markdownFile.Directory, segmentsBFirst));
else
file = Path.GetFullPath(Path.Combine(markdownFile.Directory, segmentsBFirst[..^3]));
relativeFile = Path.GetRelativePath(record.Source, file).Replace('\\', '/');
line = $"{segmentsC.First()}[[{relativeFile}]]{segmentsB.Last()}";
line = $"{segmentsA.First()}]({relativeFile}){segmentsB.Last()}";
if (lines[i] == line)
throw new NotSupportedException($"Line {i} shouldn't match with {line}");
lines[i] = line;