LinksLoader: Ignore non local links

In Reference links

Fixes APP-9M
This commit is contained in:
Vishesh Handa
2020-08-31 08:55:08 +02:00
parent a8af8d795e
commit 0b4867da10
2 changed files with 8 additions and 2 deletions

View File

@ -92,8 +92,11 @@ List<Link> _parseLinks(String body, String parentFolderPath) {
}
doc.linkReferences.forEach((key, value) {
var filePath = value.destination;
links.add(Link(term: key, filePath: filePath));
var path = value.destination;
var isLocal = !path.contains('://');
if (isLocal) {
links.add(Link(term: key, filePath: path));
}
});
return links;

View File

@ -12,6 +12,9 @@ void main() {
[Google](https://google.com)
[Google's Homepage][Google]
[Google]: https://www.google.com/
""";
test('Should load links', () async {