codeblockToOp method
Converts a code block HTML element (<pre>
) to Delta operations.
Implementation
@override
List<Operation> codeblockToOp(dom.Element element) {
final Delta delta = Delta();
Map<String, dynamic> blockAttributes = {'code-block': true};
for (final node in element.nodes) {
processNode(node, {}, delta);
}
delta.insert('\n', blockAttributes);
return delta.toList();
}