register static method
Registers a cleaner function with a unique name.
This method allows you to register a cleaner function that can later be referenced by name in parser configurations. If a cleaner with the same name already exists, it will be overwritten.
Parameters:
name: Unique name to register the cleaner function undercleaner: The cleaner function to register
Example:
CleanerRegistry.register('removeHtml', (data, extractedData, debug) {
if (data.obj is String) {
return (data.obj as String).replaceAll(RegExp(r'<[^>]*>'), '');
}
return null;
});
Implementation
static void register(String name, CleanerFunction cleaner) {
_cleaners[name] = cleaner;
}