apply method
Implementation
@override
Future<String> apply(String content, Map<String, dynamic> context) async {
return content.replaceAllMapped(_jsRegex, (match) {
final path = match.group(1)!.trim();
// Remove quotes if present
final cleanPath = path.replaceAll('"', '').replaceAll("'", '');
if (_urlService != null) {
return '<script src="${_urlService.js(cleanPath)}"></script>';
} else {
return '<script src="/assets/js/$cleanPath"></script>';
}
});
}