getBlock method
get block from plugins' rendering map If no match, then use default
Implementation
BaseBlock getBlock(BaseBlock block, List<BasePlugin> plugins) {
for (var plugin in plugins) {
for (var style in block.inlineStyles) {
if (plugin.inlineStyleRenderFn?.containsKey(style) ?? false) {
return plugin.inlineStyleRenderFn![style]!.copyWith(block: block);
}
}
for (var entity in block.entityTypes) {
if (plugin.entityRenderFn?.containsKey(entity) ?? false) {
return plugin.entityRenderFn![entity]!.copyWith(block: block);
}
}
}
return block;
}