/// <summary> /// Opens a <typeparamref name="TProxy"/> if a line begins with at least 3 fence characters. /// </summary> /// <param name="blockProcessor">The <see cref="BlockProcessor"/> for the document that contains a line with a fence character as its first character.</param> /// <returns> /// <see cref="BlockState.None"/> if the current line has code indent. /// <see cref="BlockState.None"/> if the current line does not contain an opening fence. /// <see cref="BlockState.ContinueDiscard"/> if the current line contains an opening fence and a <typeparamref name="TProxy"/> is opened. ///</returns> protected override BlockState TryOpenBlock(BlockProcessor blockProcessor) { if (blockProcessor.IsCodeIndent) { return(BlockState.None); } // First line of a JSONBlock must begin with <opening char>{ if (blockProcessor.PeekChar(1) != '{') { return(BlockState.None); } // Create block TProxy proxyJsonBlock = _jsonBlockFactory.CreateProxyJsonBlock(blockProcessor, this); blockProcessor.NewBlocks.Push(proxyJsonBlock); // Dispose of first char (JSON starts at the curly bracket) blockProcessor.NextChar(); return(ParseLine(blockProcessor.Line, proxyJsonBlock)); }