public HtmlPolicyBuilder allowElements ( ElementPolicy policy , String ... elementNames ) { invalidateCompiledState ( ) ; for ( String elementName : elementNames ) { elementName = HtmlLexer . canonicalName ( elementName ) ; ElementPolicy newPolicy = ElementPolicy . Util . join ( elPolicies . get ( elementName ) , policy ) ; // Don't remove if newPolicy is the always reject policy since we want // that to infect later allowElement calls for this particular element // name. rejects should have higher priority than allows. elPolicies . put ( elementName , newPolicy ) ; if ( ! textContainers . containsKey ( elementName ) ) { if ( METADATA . canContainPlainText ( METADATA . indexForName ( elementName ) ) ) { textContainers . put ( elementName , true ) ; } } } return this ; }
Allow the given elements with the given policy .