Exemplo n.º 1
0
        public static MarkdownPipelineBuilder UseCodeBlockAnnotations(
            this MarkdownPipelineBuilder pipeline,
            CodeFenceAnnotationsParser annotationsParser = null)
        {
            var extensions = pipeline.Extensions;

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

            return(pipeline);
        }
Exemplo n.º 2
0
 public AnnotatedCodeBlockParser(CodeFenceAnnotationsParser codeFenceAnnotationsParser)
 {
     this.codeFenceAnnotationsParser = codeFenceAnnotationsParser ?? throw new ArgumentNullException(nameof(codeFenceAnnotationsParser));
     OpeningCharacters = new[] { '`' };
     InfoParser        = ParseCodeOptions;
 }
Exemplo n.º 3
0
 public CodeBlockAnnotationExtension(CodeFenceAnnotationsParser annotationsParser = null)
 {
     _annotationsParser = annotationsParser ?? new CodeFenceAnnotationsParser();
 }