Use .text( '\u00A0' ) instead of .html( ' ' )

On reading the HTML by .html() in the tests the content is still
' '.

Bug: T154300
Change-Id: I2f43909c5539a5882af354fc8f64b03e43697647
This commit is contained in:
Fomafix 2023-04-24 18:37:07 +00:00 committed by Jdlrobson
parent 7ce1741121
commit 90a1949444
4 changed files with 9 additions and 9 deletions

View file

@ -93,12 +93,12 @@
.append( .append(
$( '<span>' ) $( '<span>' )
.addClass( 'mw-mmv-download-image-size-name' ) .addClass( 'mw-mmv-download-image-size-name' )
.html( '&nbsp;' ) .text( '\u00A0' )
) )
.append( .append(
$( '<span>' ) $( '<span>' )
.addClass( 'mw-mmv-download-image-size' ) .addClass( 'mw-mmv-download-image-size' )
.html( '&nbsp;' ) .text( '\u00A0' )
); );
$container $container

View file

@ -54,7 +54,7 @@
.addClass( 'mw-mmv-share-page-link' ) .addClass( 'mw-mmv-share-page-link' )
.prop( 'alt', mw.message( 'multimediaviewer-link-to-page' ).text() ) .prop( 'alt', mw.message( 'multimediaviewer-link-to-page' ).text() )
.prop( 'target', '_blank' ) .prop( 'target', '_blank' )
.html( '&nbsp;' ) .text( '\u00A0' )
.appendTo( this.$pane ); .appendTo( this.$pane );
this.pageInput.$element.appendTo( this.$pane ); this.pageInput.$element.appendTo( this.$pane );

View file

@ -41,7 +41,7 @@
this.$reuse = $( '<a>' ) this.$reuse = $( '<a>' )
.attr( 'role', 'button' ) .attr( 'role', 'button' )
.addClass( 'mw-mmv-reuse-button' ) .addClass( 'mw-mmv-reuse-button' )
.html( '&nbsp;' ) .text( '\u00A0' )
.prop( 'title', mw.message( 'multimediaviewer-reuse-link' ).text() ) .prop( 'title', mw.message( 'multimediaviewer-reuse-link' ).text() )
.tipsy( { .tipsy( {
delayIn: tooltipDelay, delayIn: tooltipDelay,
@ -60,7 +60,7 @@
this.$download = $( '<a>' ) this.$download = $( '<a>' )
.attr( 'role', 'button' ) .attr( 'role', 'button' )
.addClass( 'mw-mmv-download-button' ) .addClass( 'mw-mmv-download-button' )
.html( '&nbsp;' ) .text( '\u00A0' )
.prop( 'title', mw.message( 'multimediaviewer-download-link' ).text() ) .prop( 'title', mw.message( 'multimediaviewer-download-link' ).text() )
.tipsy( { .tipsy( {
delayIn: tooltipDelay, delayIn: tooltipDelay,
@ -70,12 +70,12 @@
this.$next = $( '<button>' ) this.$next = $( '<button>' )
.prop( 'title', mw.message( 'multimediaviewer-next-image-alt-text' ).text() ) .prop( 'title', mw.message( 'multimediaviewer-next-image-alt-text' ).text() )
.addClass( 'mw-mmv-next-image disabled' ) .addClass( 'mw-mmv-next-image disabled' )
.html( '&nbsp;' ); .text( '\u00A0' );
this.$prev = $( '<button>' ) this.$prev = $( '<button>' )
.prop( 'title', mw.message( 'multimediaviewer-prev-image-alt-text' ).text() ) .prop( 'title', mw.message( 'multimediaviewer-prev-image-alt-text' ).text() )
.addClass( 'mw-mmv-prev-image disabled' ) .addClass( 'mw-mmv-prev-image disabled' )
.html( '&nbsp;' ); .text( '\u00A0' );
this.$nav = this.$next this.$nav = this.$next
.add( this.$prev ); .add( this.$prev );

View file

@ -203,7 +203,7 @@
.appendTo( this.$dialog ); .appendTo( this.$dialog );
$( '<div>' ) $( '<div>' )
.html( '&nbsp;' ) .text( '\u00A0' )
.addClass( 'mw-mmv-confirmation-close' ) .addClass( 'mw-mmv-confirmation-close' )
.on( 'click', function () { .on( 'click', function () {
dialog.closeDialog(); dialog.closeDialog();
@ -362,7 +362,7 @@
$subContainer = $( '<div>' ).addClass( 'mw-mmv-options-subcontainer' ); $subContainer = $( '<div>' ).addClass( 'mw-mmv-options-subcontainer' );
$( '<div>' ) $( '<div>' )
.html( '&nbsp;' ) .text( '\u00A0' )
.addClass( 'mw-mmv-options-icon' ) .addClass( 'mw-mmv-options-icon' )
.appendTo( $subContainer ); .appendTo( $subContainer );