Skip to content

Commit

Permalink
Test case for link with & from Markdown document
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Feb 6, 2023
1 parent e990cb1 commit 05f8dd1
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ public void QueryAndFragmentWithLinkText()
writer.ToString().ShouldBe(@"<a href=""/a/b/c?abc=123#xyz"">Foo</a>");
}
}

[Test]
public void LinkFromMarkdown()
{
// Given
TestDocument document = new TestDocument(new NormalizedPath("a/b/c"));
IHtmlHelper htmlHelper = new TestHtmlHelper();

// When
IHtmlContent result = htmlHelper.DocumentLink(document, "abc=123&amp;xyz=456", "Foo");

// Then
using (StringWriter writer = new StringWriter())
{
result.WriteTo(writer, HtmlEncoder.Default);
writer.ToString().ShouldBe(@"<a href=""/a/b/c?abc=123&amp;xyz=456"">Foo</a>");
}
}
}

public class CachedPartialTests : IHtmlHelperExtensionsFixture
Expand Down

0 comments on commit 05f8dd1

Please sign in to comment.