HtmlToDelta constructor

HtmlToDelta({
  1. HtmlOperations? htmlToOperations,
  2. List<String> blackNodesList = const [],
  3. List<CustomHtmlPart>? customBlocks,
  4. bool trimText = true,
  5. 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.trimText = true,
  this.replaceNormalNewLinesToBr = false,
}) {
  htmlToOp = htmlToOperations ?? DefaultHtmlToOperations();
  //this part ensure to set the customBlocks passed at the constructor
  htmlToOp.setCustomBlocks(customBlocks ?? []);
}