DeltaToMarkdown constructor

DeltaToMarkdown({
  1. Map<String, EmbedToMarkdown>? customEmbedHandlers,
  2. Map<String, CustomAttributeHandler>? customTextAttrsHandlers,
  3. DeltaToMarkdownVisitLineHandleNewLine? visitLineHandleNewLine,
  4. CustomContentHandler customContentHandler = escapeSpecialCharacters,
})

Implementation

DeltaToMarkdown({
  Map<String, EmbedToMarkdown>? customEmbedHandlers,
  Map<String, CustomAttributeHandler>? customTextAttrsHandlers,
  this.visitLineHandleNewLine,
  this.customContentHandler = escapeSpecialCharacters,
}) {
  if (customEmbedHandlers != null) {
    _embedHandlers.addAll(customEmbedHandlers);
  }

  if (customTextAttrsHandlers != null) {
    for (final entry in customTextAttrsHandlers.entries) {
      _textAttrsHandlers[entry.key] = _AttributeHandler(
        beforeContent: entry.value.beforeContent,
        afterContent: entry.value.afterContent,
      );
    }
  }
}