diff --git a/Helpers/HelperMarkdown.cs b/Helpers/HelperMarkdown.cs index d18a4b1..e61dc5e 100644 --- a/Helpers/HelperMarkdown.cs +++ b/Helpers/HelperMarkdown.cs @@ -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('['); - file = Path.GetFullPath(Path.Combine(markdownFile.Directory, segmentsBFirst)); + 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;