d3r1ck
Is there a way to format text in an OOUI MessageDialog to accommodate line break? I’ve tried <br/>
, \n
and \n\n
but these doesn’t work as expected.
Thanks for your guidance in advance!
Is there a way to format text in an OOUI MessageDialog to accommodate line break? I’ve tried <br/>
, \n
and \n\n
but these doesn’t work as expected.
Thanks for your guidance in advance!
You could use an HtmlSnippet, something like:
mw.loader.using('oojs-ui-windows', function () {
var messageDialog = new OO.ui.MessageDialog();
OO.ui.getWindowManager().addWindows( [ messageDialog ] );
OO.ui.getWindowManager().openWindow( messageDialog, {
message: new OO.ui.HtmlSnippet("Message with<br>a line break.")
} );
});
Thank you very much @samwilson. Your proposed solution works great!