コード例 #1
0
        public static MarkdownPipelineBuilder UseCodeBlockAnnotations(
            this MarkdownPipelineBuilder pipeline,
            CodeFenceAnnotationsParser annotationsParser = null,
            bool inlineControls = true)
        {
            var extensions = pipeline.Extensions;

            if (!extensions.Contains <CodeBlockAnnotationExtension>())
            {
                extensions.Add(new CodeBlockAnnotationExtension(annotationsParser)
                {
                    InlineControls = inlineControls
                });
            }

            return(pipeline);
        }
コード例 #2
0
 public AnnotatedCodeBlockParser(CodeFenceAnnotationsParser codeFenceAnnotationsParser)
 {
     _codeFenceAnnotationsParser = codeFenceAnnotationsParser ?? throw new ArgumentNullException(nameof(codeFenceAnnotationsParser));
     OpeningCharacters           = new[] { '`' };
     InfoParser = ParseCodeOptions;
 }
コード例 #3
0
 public CodeBlockAnnotationExtension(CodeFenceAnnotationsParser annotationsParser = null)
 {
     _annotationsParser = annotationsParser ?? new CodeFenceAnnotationsParser();
 }