diff --git a/modules/ve-mw/init/ve.init.mw.Target.js b/modules/ve-mw/init/ve.init.mw.Target.js index f493286f1a..3b9ca17800 100644 --- a/modules/ve-mw/init/ve.init.mw.Target.js +++ b/modules/ve-mw/init/ve.init.mw.Target.js @@ -191,8 +191,11 @@ ve.init.mw.Target.prototype.createModelFromDom = function () { ve.init.mw.Target.static.parseDocument = function ( documentString, mode ) { var doc; if ( mode === 'source' ) { + // Add trailing linebreak to wikitext documents for consistency + // with old editor and usability. Will be stripped on save. T156609 + documentString += '\n'; // Parent method - doc = ve.init.mw.Target.super.static.parseDocument.apply( this, arguments ); + doc = ve.init.mw.Target.super.static.parseDocument.call( this, documentString, mode ); } else { // Parsoid documents are XHTML so we can use parseXhtml which fixed some IE issues. doc = ve.parseXhtml( documentString );