diff --git a/lib/app_sources/html.dart b/lib/app_sources/html.dart index 92178bf..8067b26 100644 --- a/lib/app_sources/html.dart +++ b/lib/app_sources/html.dart @@ -41,9 +41,14 @@ class HTML extends AppSource { } catch (err) { // is relative } - var currPathSegments = uri.path.split('/'); + var currPathSegments = uri.path + .split('/') + .where((element) => element.trim().isNotEmpty) + .toList(); if (e.startsWith('/') || currPathSegments.isEmpty) { return '${uri.origin}/$e'; + } else if (e.split('/').length == 1) { + return '${uri.origin}/${currPathSegments.join('/')}/$e'; } else { return '${uri.origin}/${currPathSegments.sublist(0, currPathSegments.length - 1).join('/')}/$e'; }