mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Follow-up I80d82ad87: Only add linebreak to non-empty documents
This is the same behaviour as the old editor, and unbreaks editors that use placeholders. Change-Id: I7b5a18f1fb0d41c5dc08d1b893c90db2bf3dbd86
This commit is contained in:
parent
26e78ea946
commit
38dba57e95
|
@ -215,9 +215,9 @@ ve.init.mw.ArticleTarget.static.documentCommands = ve.init.mw.ArticleTarget.supe
|
|||
* @inheritdoc
|
||||
*/
|
||||
ve.init.mw.ArticleTarget.static.parseDocument = function ( documentString, mode ) {
|
||||
// Add trailing linebreak to wikitext documents for consistency
|
||||
// Add trailing linebreak to non-empty wikitext documents for consistency
|
||||
// with old editor and usability. Will be stripped on save. T156609
|
||||
if ( mode === 'source' ) {
|
||||
if ( mode === 'source' && documentString ) {
|
||||
documentString += '\n';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue