private void registerMandatoryAttributes ( Attributes attributes ) { // see https://sourceforge.net/p/jerichohtml/discussion/350024/thread/501a7d05/ Map < String , String > attrs = context . getMandatoryAttributes ( ) ; if ( ! attrs . isEmpty ( ) ) { for ( Entry < String , String > i : attrs . entrySet ( ) ) { String v = i . getValue ( ) ; if ( v == null ) { outputDocument . insert ( attributes . getBegin ( ) , " " + i . getKey ( ) + " " ) ; } else { outputDocument . insert ( attributes . getBegin ( ) , " " + i . getKey ( ) + "\"" + v + "\" " ) ; } } } }
Register mandatory attributes for Scoped CSS