/// <summary> /// Disable HTML rendering and make it plain text. /// </summary> /// <param name="renderer">The object renderer collection.</param> /// <param name="disable">Whether to disable html rendering.</param> /// <returns>The original collection to chain.</returns> public static ObjectRendererCollection DisableHtml(this ObjectRendererCollection renderer, bool disable = true) { if (!disable) { return(renderer); } renderer.Replace <HtmlBlockRenderer>(new HtmlEscapedRenderer()); renderer.Replace <HtmlInlineRenderer>(new HtmlEscapedInlineRenderer()); return(renderer); }
/// <summary> /// Disable link rendering and make it plain text. /// </summary> /// <param name="renderer">The object renderer collection.</param> /// <param name="disable">Whether to disable link rendering.</param> /// <returns>The original collection to chain.</returns> public static ObjectRendererCollection DisableLink(this ObjectRendererCollection renderer, bool disable = true) { if (!disable) { return(renderer); } renderer.Replace <LinkInlineRenderer>(new ProtectedLinkInlineRenderer()); return(renderer); }