Beispiel #1
0
 /// <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;
     }
 }
Beispiel #2
0
        /// <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);
                }
            }
        }
Beispiel #3
0
 public void AfterMarkdownRendered(ModifyHtmlAndHeadersArguments args)
 {
 }