Download MarkdigMantisLink.zip, last updated 05/08/2017 (10.77 KB)

Download
  • md5: 0732dcf3eadac30820596c4fd7bea306
  • sha1: b09fac52bfaac22748f6c8210d197492494614e5
  • sha256: 1dbb16d0bf3c2416992efe83e97ac37b5e886d7c0aa752007d3c8c459afdcdd9
// Copyright (c) 2017 Cyotek Ltd.
// http://www.cyotek.com/blog/writing-custom-markdig-extensions
// Licensed under the MIT License. See LICENSE.txt for the full text.

using Markdig;
using Markdig.Helpers;

namespace MarkdigMantisLink
{
  public static class MantisLinkerExtensions
  {
    #region Static Methods

    public static MarkdownPipelineBuilder UseMantisLinks(this MarkdownPipelineBuilder pipeline, MantisLinkOptions options)
    {
      OrderedList<IMarkdownExtension> extensions;

      extensions = pipeline.Extensions;

      if (!extensions.Contains<MantisLinkerExtension>())
      {
        extensions.Add(new MantisLinkerExtension(options));
      }

      return pipeline;
    }

    #endregion
  }
}

Donate

Donate