This is text.
\n", result); } [Fact] public void BlankStringHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown.ToHtml( "", pipeline); Assert.Equal("", result); } [Fact] public void LabeledWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test|Label]]", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } [Fact] public void PossessiveLabeledWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test|Label]]'s", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } [Fact] public void PossessiveWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test]]'s", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } [Fact] public void PunctuationLabeledWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test|Label]].", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } [Fact] public void PunctuationWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test]].", pipeline) .Replace("%5E", "^"); Assert.Equal("Test.
\n", result); } [Fact] public void SentenceWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "This is a [[test]] of this system.", pipeline) .Replace("%5E", "^"); Assert.Equal( "This is a test of this system.
\n", result); } [Fact] public void SimpleWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test]]", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } [Fact] public void StandardLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown.ToHtml( "[Test](https://test/)", pipeline); Assert.Equal("\n", result); } [Fact] public void TrailingLabeledWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test|Label]]s", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } [Fact] public void TrailingWikiLinkHtml() { MarkdownPipeline pipeline = CreatePipeline(); string result = Markdig.Markdown .ToHtml( "[[Test]]s", pipeline) .Replace("%5E", "^"); Assert.Equal("\n", result); } private static MarkdownPipeline CreatePipeline() { WikiLinkOptions options = new() { GetUrl = (title) => string.Format( "^{0}$", title.ToLowerInvariant().Replace(" ", "-")), }; MarkdownPipelineBuilder? builder = new MarkdownPipelineBuilder() .Use(new WikiLinkExtension(options)); MarkdownPipeline? pipeline = builder.Build(); return pipeline; } }