src/main/java/org/jsoup/parser/Tag.java
/**
     Test if this tag, the prospective parent, can accept the proposed child.
     @param child potential child tag.
     @return true if this can contain child.
     */
Test if this tag, the prospective parent, can accept the proposed child.
Test if this tag the prospective parent can accept the proposed child .
boolean canContain(Tag child) {
        Validate.notNull(child);
        if (child.isBlock && !this.canContainBlock)
            return false;
        if (!child.isBlock && !this.canContainInline) 
            return false;
        if (this.optionalClosing && this.equals(child))
            return false;
        if (this.empty || this.isData())
            return false;
        if (this.tagName.equals("head")) {
            if (child.tagName.equals("base") || child.tagName.equals("script") || child.tagName.equals("noscript") || child.tagName.equals("link") ||
                    child.tagName.equals("meta") || child.tagName.equals("title") || child.tagName.equals("style") || child.tagName.equals("object")) {
                return true;
            }
            return false;
        }
        if (this.tagName.equals("dt") && child.tagName.equals("dd"))
            return false;
        if (this.tagName.equals("dd") && child.tagName.equals("dt"))
            return false;
        return true;
    }
boolean canContain ( Tag child ) { Validate . notNull ( child ) ; if ( child . isBlock && ! this . canContainBlock ) return false ; if ( ! child . isBlock && ! this . canContainInline ) return false ; if ( this . optionalClosing && this . equals ( child ) ) return false ; if ( this . empty || this . isData ( ) ) return false ; if ( this . tagName . equals ( "head" ) ) { if ( child . tagName . equals ( "base" ) || child . tagName . equals ( "script" ) || child . tagName . equals ( "noscript" ) || child . tagName . equals ( "link" ) || child . tagName . equals ( "meta" ) || child . tagName . equals ( "title" ) || child . tagName . equals ( "style" ) || child . tagName . equals ( "object" ) ) { return true ; } return false ; } if ( this . tagName . equals ( "dt" ) && child . tagName . equals ( "dd" ) ) return false ; if ( this . tagName . equals ( "dd" ) && child . tagName . equals ( "dt" ) ) return false ; return true ; }
Test if this tag, the prospective parent, can accept the proposed child.
Test if this tag the prospective parent can accept the proposed child .
// not block == inline // head can only contain a few. if more than head in here, modify to have a list of valids // TODO: (could solve this with walk for ancestor) // dt and dd (in dl)