HtmlToDelta constructor

HtmlToDelta({
  1. HtmlOperations? htmlToOperations,
  2. List<String> blackNodesList = const [],
  3. List<CustomHtmlPart>? customBlocks,
  4. bool shouldInsertANewLine(
    1. String localName
    )?,
  5. bool isBlockValidator(
    1. String localName
    )?,
  6. bool replaceNormalNewLinesToBr = false,
})

Creates a new instance of HtmlToDelta.

htmlToOperations defines how common HTML tags are converted to Delta operations. customBlocks allows adding custom rules for handling specific HTML tags.

Implementation

HtmlToDelta({
  HtmlOperations? htmlToOperations,
  this.blackNodesList = const [],
  this.customBlocks,
  this.shouldInsertANewLine,
  this.isBlockValidator,
  this.replaceNormalNewLinesToBr = false,
}) {
  htmlToOp = htmlToOperations ?? DefaultHtmlToOperations();
  //this part ensure to set the customBlocks passed at the constructor
  htmlToOp.setCustomBlocks(customBlocks ?? []);
}