CommonUtils.Core/HtmlContent.cs

(完整代码) 1006B

using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace CommonUtils
{
    public static class HtmlContent
    {
        public static IHtmlContent RelocalMeta(this IHtmlHelper htmlHelper, string url)
        => htmlHelper.Raw(HtmlUtil.GetRelocalMeta(url));

        public static IHtmlContent Parse(string value)
        => new HtmlString(value);

        public static IHtmlContent ToHtmlContent(this string value)
        => new HtmlString(value);

        public static IHtmlContent ToHtmlToContent(this string text)
        => text.ToHtml().ToHtmlContent();

        public static IHtmlContent GetRelocalMeta(string url)
        => Parse(HtmlUtil.GetRelocalMeta(url));

        public static readonly IHtmlContent Utf8Meta = Parse(HtmlUtil.CharsetMeta);

        public static readonly IHtmlContent ViewPortScaleMeta = Parse(HtmlUtil.ViewPortScaleMeta);

        public static IHtmlContent GetIconLink(string path)
        => Parse(HtmlUtil.GetIconLink(path));
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。