Exemplo n.º 1
0
        //TODO: implement real implicit closing logic from HTML5 spec
        // see http://www.w3.org/html/wg/drafts/html/master/syntax.html#syntax-tag-omission
        public static bool IsImplicitlyClosedBy(this XElement parent, INamedXObject current)
        {
            //inline and paragraph tags are implicitly closed by block tags and paragraph tags
            if (ElementTypes.IsInline(parent.Name.Name) || ElementTypes.IsParagraph(parent.Name.Name))
            {
                return(ElementTypes.IsBlock(current.Name.Name) || ElementTypes.IsParagraph(current.Name.Name));
            }

            return(false);
        }