HtmlToDelta class

Default converter for html to Delta

Constructors

HtmlToDelta({HtmlOperations? htmlToOperations, List<String> blackNodesList = const [], List<CustomHtmlPart>? customBlocks, bool shouldInsertANewLine(String localName)?, bool isBlockValidator(String localName)?, bool replaceNormalNewLinesToBr = false, CSSVarible? onDetectLineheightCssVariable})
Creates a new instance of HtmlToDelta.

Properties

blackNodesList → List<String>
This is a list that must contains only the tag name of the all HTML Nodes (<p>, <div> or <h1>) that will be ignored and inserted as plain text
final
customBlocks → List<CustomHtmlPart>?
List of custom HTML parts to handle non-common HTML tags.
final
hashCode → int
The hash code for this object.
no setterinherited
htmlToOp ↔ HtmlOperations
Converts HTML tags to Delta operations based on defined rules.
getter/setter pair
isBlockValidator → bool Function(String localName)?
Function to determine if a node is a block element.
final
onDetectLineheightCssVariable → CSSVarible?
When a variable of CSS is detected, this is called to avoid just putting a default unwanted value.
final
replaceNormalNewLinesToBr → bool
Replace all new lines (\n) to <br>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shouldInsertANewLine → bool Function(String localName)?
Function to determine if a new line should be inserted after a node.
final

Methods

convert(String htmlText, {bool transformTableAsEmbed = false}) → Delta
Converts an HTML string into Delta operations.
convertDocument(Document $document, {bool transformTableAsEmbed = false}) → Delta
Converts a full DOM document into Delta operations.
nodeToOperation(Node node, HtmlOperations htmlToOp, [bool nextIsBlock = false, bool transformTableAsEmbed = false]) → List<Operation>
Converts a single DOM node into Delta operations using htmlToOp.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited