import { AnnotationGeneratorStrategyAbstract } from './annotation-generator-strategy.abstract';
/** Handle image alt annotation */
export class ImageAltAnnotationHandler extends AnnotationGeneratorStrategyAbstract {
  /**
   * @inheritDoc
   */
  canHandle(targetDto) {
    return targetDto.name === 'RTEImageNode';
  }
  /**
   * Handle annotation.
   *
   * @param {HTMLElement} element - Current elements.
   * @returns {VegaRTEImageAnnotations} - Annotation.
   */
  handle(element) {
    return element.hasAttribute('alt') ? { alt: element.getAttribute('alt') } : {};
  }
}
