Hugo Titles
This commit is contained in:
parent
012cfcfafc
commit
d6266139f8
@ -815,7 +815,6 @@ internal static partial class HelperMarkdown
|
|||||||
string? directory;
|
string? directory;
|
||||||
string[] segmentsA;
|
string[] segmentsA;
|
||||||
string[] segmentsB;
|
string[] segmentsB;
|
||||||
string[] segmentsC;
|
|
||||||
string relativeFile;
|
string relativeFile;
|
||||||
string segmentsALast;
|
string segmentsALast;
|
||||||
string segmentsBFirst;
|
string segmentsBFirst;
|
||||||
@ -845,10 +844,12 @@ internal static partial class HelperMarkdown
|
|||||||
if (segmentsB.Length != 2)
|
if (segmentsB.Length != 2)
|
||||||
continue;
|
continue;
|
||||||
segmentsBFirst = segmentsB.First();
|
segmentsBFirst = segmentsB.First();
|
||||||
segmentsC = segmentsA.First().Split('[');
|
if (!segmentsBFirst.EndsWith(".md"))
|
||||||
file = Path.GetFullPath(Path.Combine(markdownFile.Directory, segmentsBFirst));
|
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('\\', '/');
|
relativeFile = Path.GetRelativePath(record.Source, file).Replace('\\', '/');
|
||||||
line = $"{segmentsC.First()}[[{relativeFile}]]{segmentsB.Last()}";
|
line = $"{segmentsA.First()}]({relativeFile}){segmentsB.Last()}";
|
||||||
if (lines[i] == line)
|
if (lines[i] == line)
|
||||||
throw new NotSupportedException($"Line {i} shouldn't match with {line}");
|
throw new NotSupportedException($"Line {i} shouldn't match with {line}");
|
||||||
lines[i] = line;
|
lines[i] = line;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user