/// <summary> /// Add script block into the document /// </summary> /// <param name="args"></param> public void AfterMarkdownRendered(ModifyHtmlAndHeadersArguments args) { if (args.Markdown.Contains(" class=\"mermaid\"") || args.Markdown.Contains("\n```mermaid")) { args.HeadersToEmbed = MermaidHeaderScript; } }
/// <summary> /// Processed after Markdown has been rendered into HTML, but not been /// merged into the template. /// /// You can modify the HTML and also add headers to be rendered into the HEAD /// of the template here. /// </summary> /// <param name="args"></param> public void ProcessAllAfterMarkdownRenderedHooks(ModifyHtmlAndHeadersArguments args) { foreach (var extension in RenderExtensions) { args.HeadersToEmbed = null; // update html content using the ref HTML parameter try { extension.AfterMarkdownRendered(args); } catch (Exception ex) { mmApp.Log($"AfterMarkdownRendered RenderExtension failed: {extension.GetType().Name}", ex); } if (args.HeadersToEmbed != null) { args.MarkdownDocument.AddExtraHeaders(args.HeadersToEmbed); } } }
public void AfterMarkdownRendered(ModifyHtmlAndHeadersArguments args) { }