apply method
Implementation
@override
Future<String> apply(String content, Map<String, dynamic> context) async {
return content.replaceAllMapped(_assetRegex, (match) {
final path = match.group(1)!.trim();
// Remove quotes if present
final cleanPath = path.replaceAll('"', '').replaceAll("'", '');
// Use URL service if available, otherwise fallback to basic path
if (_urlService != null) {
return _urlService.asset(cleanPath);
} else {
return '/assets/$cleanPath';
}
});
}