/// <summary> /// Initializes a new instance of the <see cref="InlineProcessor" /> class. /// </summary> /// <param name="stringBuilders">The string builders.</param> /// <param name="document">The document.</param> /// <param name="parsers">The parsers.</param> /// <param name="inlineCreated">The inline created event.</param> /// <exception cref="System.ArgumentNullException"> /// </exception> public InlineProcessor(StringBuilderCache stringBuilders, MarkdownDocument document, InlineParserList parsers, bool preciseSourcelocation) { StringBuilders = stringBuilders ?? throw new ArgumentNullException(nameof(stringBuilders)); Document = document ?? throw new ArgumentNullException(nameof(document)); Parsers = parsers ?? throw new ArgumentNullException(nameof(parsers)); PreciseSourceLocation = preciseSourcelocation; lineOffsets = new List <StringLineGroup.LineOffset>(); ParserStates = new object[Parsers.Count]; LiteralInlineParser = new LiteralInlineParser(); }
/// <summary> /// Initializes a new instance of the <see cref="InlineProcessor" /> class. /// </summary> /// <param name="document">The document.</param> /// <param name="parsers">The parsers.</param> /// <param name="preciseSourcelocation">A value indicating whether to provide precise source location.</param> /// <param name="context">A parser context used for the parsing.</param> /// <exception cref="ArgumentNullException"> /// </exception> public InlineProcessor(MarkdownDocument document, InlineParserList parsers, bool preciseSourcelocation, MarkdownParserContext context) { if (document == null) { ThrowHelper.ArgumentNullException(nameof(document)); } if (parsers == null) { ThrowHelper.ArgumentNullException(nameof(parsers)); } Document = document; Parsers = parsers; Context = context; PreciseSourceLocation = preciseSourcelocation; lineOffsets = new List <StringLineGroup.LineOffset>(); ParserStates = new object[Parsers.Count]; LiteralInlineParser = new LiteralInlineParser(); }