< Summary

Information
Class: OzonOrdersWeb.Areas.Public.OgHtml
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Public/OgHtml.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 17
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Attribute(...)0%620%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Public/OgHtml.cs

#LineLine coverage
 1namespace OzonOrdersWeb.Areas.Public;
 2
 3/// <summary>
 4/// Escapes only characters unsafe inside HTML attributes, preserving UTF-8 (Cyrillic) for OG crawlers.
 5/// </summary>
 6public static class OgHtml
 7{
 8    public static string Attribute(string? value)
 9    {
 010        if (string.IsNullOrEmpty(value))
 011            return string.Empty;
 12
 013        return value
 014            .Replace("&", "&amp;", StringComparison.Ordinal)
 015            .Replace("\"", "&quot;", StringComparison.Ordinal);
 16    }
 17}

Methods/Properties

Attribute(System.String)