Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge X.PagedList lib into the code #757

Merged
merged 15 commits into from
Oct 12, 2023
Prev Previous commit
Next Next commit
inline methods
  • Loading branch information
EdiWang committed Oct 12, 2023
commit 9199e829b2ccf16290deabe91aa475ecbfd77af0
5 changes: 3 additions & 2 deletions src/Moonglade.Web/PagedList/HtmlHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Immutable;
using Microsoft.AspNetCore.Html;

namespace Moonglade.Web.PagedList;

Expand All @@ -16,12 +17,12 @@ public HtmlHelper(TagBuilderFactory tagBuilderFactory)

private static void SetInnerText(TagBuilder tagBuilder, string innerText)
{
tagBuilder.SetInnerText(innerText);
tagBuilder.InnerHtml.SetContent(innerText);
}

private static void AppendHtml(TagBuilder tagBuilder, string innerHtml)
{
tagBuilder.AppendHtml(innerHtml);
tagBuilder.InnerHtml.AppendHtml(innerHtml);
}

private static string TagBuilderToString(TagBuilder tagBuilder)
Expand Down
10 changes: 0 additions & 10 deletions src/Moonglade.Web/PagedList/TagBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ namespace Moonglade.Web.PagedList;

public static class TagBuilderExtensions
{
public static void AppendHtml(this TagBuilder tagBuilder, string innerHtml)
{
tagBuilder.InnerHtml.AppendHtml(innerHtml);
}

public static void SetInnerText(this TagBuilder tagBuilder, string innerText)
{
tagBuilder.InnerHtml.SetContent(innerText);
}

public static string ToString(this TagBuilder tagBuilder, TagRenderMode renderMode, HtmlEncoder encoder = null)
{
encoder ??= HtmlEncoder.Create(new TextEncoderSettings());
Expand Down