This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-nitride-cil/src/Nitride.Markdown/IdentifyMarkdownFromPath.cs
2022-06-06 09:32:22 -05:00

27 lines
579 B
C#

using FluentValidation;
using Gallium;
using Zio;
namespace Nitride.Markdown;
public class IdentifyMarkdownFromPath : IdentifyMarkdown
{
public IdentifyMarkdownFromPath(IValidator<IdentifyMarkdown> validator)
: base(validator)
{
this.IsMarkdownTest = DefaultIsMarkdown;
}
private static bool DefaultIsMarkdown(Entity entity, UPath path)
{
return (path.GetExtensionWithDot() ?? string.Empty).ToLowerInvariant() switch
{
".md" => true,
".markdown" => true,
_ => false,
};
}
}