+
+ if ( !this.$element.find( '.rcshowhide' ).contents().length ) {
+ this.$element.find( '.rcshowhide' ).detach();
+ // If we're hiding rcshowhide, the '<br>'s are around it,
+ // there's no need for them either.
+ this.$element.find( 'br' ).detach();
+ }
+
+ if ( this.$element.find( '.cloption' ).text().trim() === '' ) {
+ this.$element.find( '.cloption-submit' ).detach();
+ }
+
+ if ( mw.rcfilters.featureFlags.liveUpdate ) {
+ this.$element.find(
+ '.rclistfrom, .rcnotefrom, .rcoptions-listfromreset'
+ ).detach();
+ }
+
+ if ( this.$element.text().trim() === this.$element.find( 'legend' ).text() ) {
+ this.$element.detach();
+ }