HtmlToDelta constructor
HtmlToDelta({
- HtmlOperations? htmlToOperations,
- List<
String> blackNodesList = const [], - List<
CustomHtmlPart> ? customBlocks, - bool shouldInsertANewLine(
- String localName
- bool isBlockValidator(
- String localName
- 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 ?? []);
}