HtmlToDelta class
Default converter for html to Delta
Constructors
-
HtmlToDelta({HtmlOperations? htmlToOperations, List<
String> blackNodesList = const [], List<CustomHtmlPart> ? customBlocks, bool trimText = true, bool replaceNormalNewLinesToBr = false}) - 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 textfinal -
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
- replaceNormalNewLinesToBr → bool
-
Replace all new lines (\n) to
<br>
final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trimText → bool
-
Optionally trims converted text
final
Methods
-
convert(
String htmlText) → Delta - Converts an HTML string into Delta operations.
-
convertDocument(
Document $document) → Delta - Converts a full DOM document into Delta operations.
-
nodeToOperation(
Node node, HtmlOperations htmlToOp) → 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