Document constructor
Document({
- Iterable<
BlockSyntax> ? blockSyntaxes, - Iterable<
InlineSyntax> ? inlineSyntaxes, - ExtensionSet? extensionSet,
- Resolver? linkResolver,
- Resolver? imageLinkResolver,
- bool encodeHtml = true,
- bool withDefaultBlockSyntaxes = true,
- bool withDefaultInlineSyntaxes = true,
- bool checkable = false,
- bool preserveSpace = false,
- dynamic options,
- BlockParserBuilder blockParserBuilder = BlockParser.new,
- InlineParserBuilder inlineParserBuilder = InlineParser.new,
Implementation
Document({
Iterable<BlockSyntax>? blockSyntaxes,
Iterable<InlineSyntax>? inlineSyntaxes,
ExtensionSet? extensionSet,
this.linkResolver,
this.imageLinkResolver,
this.encodeHtml = true,
this.withDefaultBlockSyntaxes = true,
this.withDefaultInlineSyntaxes = true,
this.checkable = false,
this.preserveSpace = false,
this.options,
BlockParserBuilder blockParserBuilder = BlockParser.new,
InlineParserBuilder inlineParserBuilder = InlineParser.new,
}) : hasCustomInlineSyntaxes = (inlineSyntaxes?.isNotEmpty ?? false) ||
(extensionSet?.inlineSyntaxes.isNotEmpty ?? false),
_blockParserBuilder = blockParserBuilder,
_inlineParserBuilder = inlineParserBuilder {
if (blockSyntaxes != null) {
_blockSyntaxes.addAll(blockSyntaxes);
}
if (inlineSyntaxes != null) {
_inlineSyntaxes.addAll(inlineSyntaxes);
}
if (extensionSet == null) {
if (withDefaultBlockSyntaxes) {
_blockSyntaxes.addAll(ExtensionSet.commonMark.blockSyntaxes);
}
if (withDefaultInlineSyntaxes) {
_inlineSyntaxes.addAll(ExtensionSet.commonMark.inlineSyntaxes);
}
} else {
_blockSyntaxes.addAll(extensionSet.blockSyntaxes);
_inlineSyntaxes.addAll(extensionSet.inlineSyntaxes);
}
}