UniversalMarkdown.Parse.Elements.MarkdownLinkInline.IsUrlValid C# (CSharp) Method

IsUrlValid() private static method

Checks if the given URL is allowed in a markdown link.
private static IsUrlValid ( string url ) : bool
url string The URL to check.
return bool
        private static bool IsUrlValid(string url)
        {
            // URLs can be relative.
            if (url.StartsWith("/") || url.StartsWith("#"))
                return true;

            // Check the scheme is allowed.
            bool schemeIsAllowed = false;
            foreach (var scheme in HyperlinkInline.KnownSchemes)
            {
                if (url.StartsWith(scheme))
                {
                    schemeIsAllowed = true;
                    break;
                }
            }
            return schemeIsAllowed;
        }