mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +08:00
LinksLoader: Ignore non local links
In Reference links Fixes APP-9M
This commit is contained in:
@ -92,8 +92,11 @@ List<Link> _parseLinks(String body, String parentFolderPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doc.linkReferences.forEach((key, value) {
|
doc.linkReferences.forEach((key, value) {
|
||||||
var filePath = value.destination;
|
var path = value.destination;
|
||||||
links.add(Link(term: key, filePath: filePath));
|
var isLocal = !path.contains('://');
|
||||||
|
if (isLocal) {
|
||||||
|
links.add(Link(term: key, filePath: path));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return links;
|
return links;
|
||||||
|
@ -12,6 +12,9 @@ void main() {
|
|||||||
|
|
||||||
[Google](https://google.com)
|
[Google](https://google.com)
|
||||||
|
|
||||||
|
[Google's Homepage][Google]
|
||||||
|
|
||||||
|
[Google]: https://www.google.com/
|
||||||
""";
|
""";
|
||||||
|
|
||||||
test('Should load links', () async {
|
test('Should load links', () async {
|
||||||
|
Reference in New Issue
Block a user