protected override void BuildBlockRules() { base.BuildBlockRules(); var blockRules = BlockRules.ToList(); var index = blockRules.FindLastIndex(s => s is MarkdownNewLineBlockRule); if (index < 0) { throw new ArgumentException($"{nameof(MarkdownNewLineBlockRule)} should exist!"); } blockRules.InsertRange( index + 1, new IMarkdownRule[] { new DfmYamlHeaderBlockRule(), new AzureIncludeBlockRule(), new AzureNoteBlockRule(), new AzureSelectorBlockRule() }); index = blockRules.FindLastIndex(s => s is MarkdownHtmlBlockRule); if (index < 1) { throw new ArgumentException($"{nameof(MarkdownHtmlBlockRule)} should exist and shouldn't be the first one rule!"); } blockRules.Insert(index - 1, new AzureHtmlMetadataBlockRule()); var markdownBlockQuoteIndex = blockRules.FindIndex(item => item is MarkdownBlockquoteBlockRule); blockRules[markdownBlockQuoteIndex] = new AzureBlockquoteBlockRule(); blockRules.Insert(markdownBlockQuoteIndex, new AzureVideoBlockRule()); BlockRules = blockRules.ToImmutableList(); }
protected override void BuildBlockRules() { base.BuildBlockRules(); var blockRules = BlockRules.ToList(); var index = blockRules.FindLastIndex(s => s is MarkdownNewLineBlockRule); if (index < 0) { throw new ArgumentException($"{nameof(MarkdownNewLineBlockRule)} should exist!"); } blockRules.Insert(index + 1, new AzureIncludeBlockRule()); blockRules.Insert(index + 2, new AzureNoteBlockRule()); var gfmIndex = blockRules.FindIndex(item => item is GfmParagraphBlockRule); blockRules[gfmIndex] = new AzureParagraphBlockRule(); var markdownBlockQuoteIndex = blockRules.FindIndex(item => item is MarkdownBlockquoteBlockRule); blockRules[markdownBlockQuoteIndex] = new AzureBlockquoteBlockRule(); BlockRules = blockRules.ToImmutableList(); }