Don't use <dd> for indenting descriptions on Special:ApiSandbox
authorNicolaie Constantinescu <kosson@gmail.com>
Sun, 26 Feb 2017 15:55:44 +0000 (17:55 +0200)
committerStrainu <wiki@strainu.ro>
Sun, 26 Feb 2017 21:05:43 +0000 (23:05 +0200)
Bug: T146351
Change-Id: I29b4b2a82f190ff0ac6041b1ea712f5f9872ff12

resources/src/mediawiki.special/mediawiki.special.apisandbox.js

index c989c83..0a2684e 100644 (file)
 
                Util.fetchModuleInfo( this.apiModule )
                        .done( function ( pi ) {
-                               var prefix, i, j, dl, widget, $widgetLabel, widgetField, helpField, tmp, flag, count,
+                               var prefix, i, j, descriptionContainer, widget, $widgetLabel, widgetField, helpField, tmp, flag, count,
                                        items = [],
                                        deprecatedItems = [],
                                        buttons = [],
                                                        that.tokenWidget = widget;
                                                }
 
-                                               dl = $( '<dl>' );
-                                               dl.append( $( '<dd>', {
+                                               descriptionContainer = $( '<div>' );
+                                               descriptionContainer.append( $( '<div>', {
                                                        addClass: 'description',
                                                        append: Util.parseHTML( pi.parameters[ i ].description )
                                                } ) );
                                                if ( pi.parameters[ i ].info && pi.parameters[ i ].info.length ) {
                                                        for ( j = 0; j < pi.parameters[ i ].info.length; j++ ) {
-                                                               dl.append( $( '<dd>', {
+                                                               descriptionContainer.append( $( '<div>', {
                                                                        addClass: 'info',
                                                                        append: Util.parseHTML( pi.parameters[ i ].info[ j ] )
                                                                } ) );
 
                                                        case 'limit':
                                                                if ( pi.parameters[ i ].highmax !== undefined ) {
-                                                                       dl.append( $( '<dd>', {
+                                                                       descriptionContainer.append( $( '<div>', {
                                                                                addClass: 'info',
                                                                                append: [
                                                                                        Util.parseMsg(
                                                                                ]
                                                                        } ) );
                                                                } else {
-                                                                       dl.append( $( '<dd>', {
+                                                                       descriptionContainer.append( $( '<div>', {
                                                                                addClass: 'info',
                                                                                append: [
                                                                                        Util.parseMsg( 'api-help-param-limit', pi.parameters[ i ].max ),
                                                                        tmp += 'max';
                                                                }
                                                                if ( tmp !== '' ) {
-                                                                       dl.append( $( '<dd>', {
+                                                                       descriptionContainer.append( $( '<div>', {
                                                                                addClass: 'info',
                                                                                append: Util.parseMsg(
                                                                                        'api-help-param-integer-' + tmp,
                                                                );
                                                        }
                                                        if ( tmp.length ) {
-                                                               dl.append( $( '<dd>', {
+                                                               descriptionContainer.append( $( '<div>', {
                                                                        addClass: 'info',
                                                                        append: Util.parseHTML( tmp.join( ' ' ) )
                                                                } ) );
                                                        } ), {
                                                                align: 'inline',
                                                                classes: [ 'mw-apisandbox-help-field' ],
-                                                               label: dl
+                                                               label: descriptionContainer
                                                        }
                                                );