Exemple #1
0
    internal static RentedCustomHtmlRenderer RentCustomHtmlRenderer(this MarkdownPipeline pipeline)
    {
        HtmlRendererCache  cache    = _rendererCache ??= new(pipeline);
        CustomHtmlRenderer renderer = cache.Get();

        return(new(cache, renderer));
    }
Exemple #2
0
        internal RentedHtmlRenderer RentHtmlRenderer(TextWriter?writer = null)
        {
            HtmlRendererCache cache = writer is null
                ? _rendererCache ??= new HtmlRendererCache(this, customWriter: false)
                : _rendererCacheForCustomWriter ??= new HtmlRendererCache(this, customWriter: true);

            HtmlRenderer renderer = cache.Get();

            if (writer is not null)
            {
                renderer.Writer = writer;
            }

            return(new RentedHtmlRenderer(cache, renderer));
        }