Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BlockProcessor" /> class.
 /// </summary>
 /// <param name="stringBuilders">The string builders cache.</param>
 /// <param name="document">The document to build blocks into.</param>
 /// <param name="parsers">The list of parsers.</param>
 /// <exception cref="System.ArgumentNullException">
 /// </exception>
 public BlockProcessor(StringBuilderCache stringBuilders, MarkdownDocument document, BlockParserList parsers)
 {
     if (stringBuilders == null)
     {
         throw new ArgumentNullException(nameof(stringBuilders));
     }
     if (document == null)
     {
         throw new ArgumentNullException(nameof(document));
     }
     if (parsers == null)
     {
         throw new ArgumentNullException(nameof(parsers));
     }
     parserStateCache = new BlockParserStateCache(this);
     StringBuilders   = stringBuilders;
     Document         = document;
     document.IsOpen  = true;
     Parsers          = parsers;
     parsers.Initialize(this);
     OpenedBlocks = new List <Block>();
     NewBlocks    = new Stack <Block>();
     root         = this;
     Open(document);
 }