serialize method

  1. @override
String? serialize(
  1. Document document,
  2. DocumentNode node, {
  3. NodeSelection? selection,
})
override

Serializes the given node to a Markdown String.

When selection is null, the entire node is converted to markdown. When selection is non-null, only the selected range is converted to markdown.

Returns null if the node is not supported by this serializer.

Implementation

@override
String? serialize(
  Document document,
  DocumentNode node, {
  NodeSelection? selection,
}) {
  if (node is! NodeType) {
    return null;
  }

  return doSerialization(document, node as NodeType, selection: selection);
}