create method
Creates a component for the given node, or returns null.
Implementation
@override
Component? create(Node node, NodesBuilder builder) {
if (node
case ElementNode(tag: 'img' || 'Image', :final attributes) ||
ElementNode(tag: 'p', children: [ElementNode(tag: 'img' || 'Image', :final attributes)])) {
assert(attributes.containsKey('src'), 'Image must have a "src" argument. Found $attributes');
return from(
src: attributes['src']!,
alt: attributes['alt'],
caption: attributes['caption'],
zoom: zoom || attributes['zoom'] != null,
);
}
return null;
}