mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +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) {
|
||||
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;
|
||||
|
@ -12,6 +12,9 @@ void main() {
|
||||
|
||||
[Google](https://google.com)
|
||||
|
||||
[Google's Homepage][Google]
|
||||
|
||||
[Google]: https://www.google.com/
|
||||
""";
|
||||
|
||||
test('Should load links', () async {
|
||||
|
Reference in New Issue
Block a user