matches abstract method

bool matches(
  1. Element element
)

Determines if this custom block handler matches the given HTML element.

Implement this method to specify the conditions under which this handler should be used to convert an HTML element to Delta operations.

Parameters:

  • element: The HTML element to evaluate.

Returns: true if this handler should be used for the given HTML element, false otherwise.

Example:

class MyCustomBlock implements CustomHtmlPart {
  bool matches(dom.Element element) {
    return element.localName == 'div' && element.classes.contains('my-custom-class');
  }
}

Implementation

bool matches(dom.Element element);