internal static RentedCustomHtmlRenderer RentCustomHtmlRenderer(this MarkdownPipeline pipeline) { HtmlRendererCache cache = _rendererCache ??= new(pipeline); CustomHtmlRenderer renderer = cache.Get(); return(new(cache, renderer)); }
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)); }