Merge "Add newline to end of wikitext documents"

This commit is contained in:
jenkins-bot 2017-06-21 01:10:57 +00:00 committed by Gerrit Code Review
commit 7cd5a5d61f

View file

@ -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 );