MarkdownGenerator constructor

MarkdownGenerator({
  1. Iterable<InlineSyntax> inlineSyntaxList = const [],
  2. Iterable<BlockSyntax> blockSyntaxList = const [],
  3. EdgeInsets linesMargin = const EdgeInsets.symmetric(vertical: 8),
  4. List<SpanNodeGeneratorWithTag> generators = const [],
  5. SpanNodeAcceptCallback? onNodeAccepted,
  6. ExtensionSet? extensionSet,
  7. TextNodeGenerator? textGenerator,
  8. SpanNodeBuilder? spanNodeBuilder,
  9. RichTextBuilder? richTextBuilder,
  10. RegExp? splitRegExp,
  11. dynamic headingNodeFilter,
  12. bool preserveEmptyLines = false,
})

Use headingNodeFilter to filter the levels of headings you want to show. e.g.

(HeadingNode node) => {'h1', 'h2'}.contains(node.headingConfig.tag)

Use preserveEmptyLines to control whether to preserve empty lines in markdown. When set to true, consecutive empty lines will be converted to <br> tags. Default is false (empty lines will be filtered as per markdown spec).

Implementation

MarkdownGenerator({
  this.inlineSyntaxList = const [],
  this.blockSyntaxList = const [],
  this.linesMargin = const EdgeInsets.symmetric(vertical: 8),
  this.generators = const [],
  this.onNodeAccepted,
  this.extensionSet,
  this.textGenerator,
  this.spanNodeBuilder,
  this.richTextBuilder,
  this.splitRegExp,
  headingNodeFilter,
  this.preserveEmptyLines = false,
}) : headingNodeFilter = headingNodeFilter ?? allowAll;