From 0a2a5532f58f7811ff0dea6c6d35738eb0c10472 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 14 Sep 2020 22:12:08 +0200 Subject: [PATCH] Link Refernces: Normalize the path properly --- lib/core/link.dart | 2 +- lib/core/links_loader.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/link.dart b/lib/core/link.dart index 994c0b3b..6f2a4906 100644 --- a/lib/core/link.dart +++ b/lib/core/link.dart @@ -82,7 +82,7 @@ class LinkExtractor implements md.NodeVisitor { return; } - if (url.startsWith('#')) { + if (url.startsWith('#') || url.startsWith('//')) { var link = Link( publicTerm: title, filePath: filePath, diff --git a/lib/core/links_loader.dart b/lib/core/links_loader.dart index 476d8c7c..7c6dd406 100644 --- a/lib/core/links_loader.dart +++ b/lib/core/links_loader.dart @@ -104,7 +104,7 @@ List parseLinks(String body, String filePath) { l.headingID = path; l.filePath = filePath; } else { - l.filePath = p.join(parentFolderPath, p.normalize(path)); + l.filePath = p.normalize(p.join(parentFolderPath, path)); } links.add(l); });