RickStrahl / Westwind.Web.Markdown

Markdown support for ASP.NET WebForms and MVC applications
19 stars 7 forks source link

UseAutoLinks is causing an error in your default pipeline builder #1

Closed tjdennis closed 5 years ago

tjdennis commented 5 years ago

Hello Rick, I am getting this error when trying to use the MarkdownHttpHandler and the latest Markdig version 0.17.1.

Method not found: 'Markdig.MarkdownPipelineBuilder Markdig.MarkdownExtensions.UseAutoLinks(Markdig.MarkdownPipelineBuilder, System.String)'.

Apparently Markdig changed this function signature somewhere prior to their 0.17 release.

public static MarkdownPipelineBuilder UseAutoLinks(this MarkdownPipelineBuilder pipeline, AutoLinkOptions options = null)

I tried using your MarkdownParserMarkdig.OnCreateMarkdigPipeline function handler to override the default pipeline, but the error still persists.

MarkdownParserMarkdig.OnCreateMarkdigPipeline = (usePragmaLines) => { var builder = new Markdig.MarkdownPipelineBuilder().UseAdvancedExtensions(); if (usePragmaLines) builder = builder.UsePragmaLines(); return builder; };

I found their commit where they changed the function signature. https://github.com/lunet-io/markdig/commit/1064818b49e3b9741cef09dcb564f21fd151e2ab

Full stack trace [MissingMethodException: Method not found: 'Markdig.MarkdownPipelineBuilder Markdig.MarkdownExtensions.UseAutoLinks(Markdig.MarkdownPipelineBuilder, System.String)'.] Westwind.Web.Markdown.MarkdownParser.MarkdownParserMarkdig.CreatePipelineBuilder() +0 Westwind.Web.Markdown.MarkdownParser.MarkdownParserMarkdig..ctor(Boolean usePragmaLines, Boolean force) +37 Westwind.Web.Markdown.MarkdownParser.MarkdownParserFactory.GetParser(Boolean usePragmaLines, Boolean forceLoad, String parserAddinId) +96 Westwind.Web.Markdown.MarkdownHttpHandler.ParseMarkdownToModel(String markdown, MarkdownModel model) +682 Westwind.Web.Markdown.MarkdownHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +58 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +866 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

Thanks!

tjdennis commented 5 years ago

Looks like you just need to recompile with Markdig 0.17.0 and up the minimum Markdig version to 0.17.0. Your code looks fine :^)

Great documentation by the way!

RickStrahl commented 5 years ago

I’ve updated the dependency and the new package should be online.

Thanks.