customBlocks property

List<CustomHtmlPart>? customBlocks
final

List of custom HTML parts to handle non-common HTML tags.

These custom blocks define how to convert specific HTML tags into Delta operations.

Example:

final converter = HtmlToDelta(customBlocks: [
  MyCustomHtmlPart(
    matches: (element) => element.localName == 'my-custom-tag',
    convert: (element) {
      return [
        Operation.insert({"custom-tag": element.text})
      ];
    },
  ),
]);

Implementation

final List<CustomHtmlPart>? customBlocks;