WebMarkupMin.Core.GenericHtmlMinifier.CanRemoveAttributeQuotes C# (CSharp) Метод

CanRemoveAttributeQuotes() приватный статический Метод

Checks whether it is possible to remove the attribute quotes
private static CanRemoveAttributeQuotes ( HtmlAttribute attribute, HtmlAttributeQuotesRemovalMode attributeQuotesRemovalMode ) : bool
attribute WebMarkupMin.Core.Parsers.HtmlAttribute Attribute
attributeQuotesRemovalMode HtmlAttributeQuotesRemovalMode Removal mode of HTML attribute quotes
Результат bool
        private static bool CanRemoveAttributeQuotes(HtmlAttribute attribute,
			HtmlAttributeQuotesRemovalMode attributeQuotesRemovalMode)
        {
            string attributeValue = attribute.Value;
            bool result = false;

            if (attributeQuotesRemovalMode != HtmlAttributeQuotesRemovalMode.KeepQuotes)
            {
                if (!attributeValue.EndsWith("/"))
                {
                    if (attributeQuotesRemovalMode == HtmlAttributeQuotesRemovalMode.Html4)
                    {
                        result = _html4AttributeValueNotRequireQuotesRegex.IsMatch(attributeValue);
                    }
                    else if (attributeQuotesRemovalMode == HtmlAttributeQuotesRemovalMode.Html5)
                    {
                        result = CommonRegExps.Html5AttributeValueNotRequireQuotes.IsMatch(attributeValue);
                    }
                }
            }

            return result;
        }