MarkdownGenerator constructor
MarkdownGenerator({
- Iterable<
InlineSyntax> inlineSyntaxList = const [], - Iterable<
BlockSyntax> blockSyntaxList = const [], - EdgeInsets linesMargin = const EdgeInsets.symmetric(vertical: 8),
- List<
SpanNodeGeneratorWithTag> generators = const [], - SpanNodeAcceptCallback? onNodeAccepted,
- ExtensionSet? extensionSet,
- TextNodeGenerator? textGenerator,
- SpanNodeBuilder? spanNodeBuilder,
- RichTextBuilder? richTextBuilder,
- RegExp? splitRegExp,
- dynamic headingNodeFilter,
- 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;