diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js index a38c57e674..399cb71e36 100644 --- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js @@ -2074,17 +2074,24 @@ ve.init.mw.ViewPageTarget.prototype.restoreEditSection = function () { /** * Show an inline warning. * @param {string} name Warning's unique name - * @param {string} messageHtml Warning message HTML + * @param {string|jQuery} message Warning message (string of HTML, not text, or jQuery object) + * @param {Object} [options] + * @param {boolean} [options.wrap=true] Wrap the message in a paragraph. */ -ve.init.mw.ViewPageTarget.prototype.showWarning = function ( name, messageHtml ) { +ve.init.mw.ViewPageTarget.prototype.showWarning = function ( name, message, options ) { + var $warning; if ( !this.warnings[name] ) { - var warning = $( - '

' + messageHtml + '

' - ); - this.$saveDialog - .find( '.ve-init-mw-viewPageTarget-saveDialog-warnings' ) - .append( warning ); - this.warnings[name] = warning; + options = options || {}; + $warning = $( '
' ); + if ( options.wrap !== false ) { + $warning.append( $( '

').append( message ) ); + } else { + $warning.append( message ); + } + this.$saveDialog.find( '.ve-init-mw-viewPageTarget-saveDialog-warnings' ) + .append( $warning ); + + this.warnings[name] = $warning; } };