Merge "ve.ui.MWSaveDialog: Remove meta element filtering from wikitext preview"

This commit is contained in:
jenkins-bot 2020-03-11 15:26:05 +00:00 committed by Gerrit Code Review
commit 74ee640664

View file

@ -198,7 +198,7 @@ ve.ui.MWSaveDialog.prototype.setDiffAndReview = function ( wikitextDiffPromise,
* @param {HTMLDocument} [baseDoc] Base document against which to normalise links, if document provided
*/
ve.ui.MWSaveDialog.prototype.showPreview = function ( docOrMsg, baseDoc ) {
var body, contents, $heading, redirectMeta, deferred,
var body, $heading, redirectMeta, deferred,
$redirect = $(),
categories = [],
modules = [],
@ -256,15 +256,12 @@ ve.ui.MWSaveDialog.prototype.showPreview = function ( docOrMsg, baseDoc ) {
);
}
// Remove metadata
contents = ve.filterMetaElements( Array.prototype.slice.call( body.childNodes ) );
this.$previewViewer.empty().append(
// TODO: This won't work with formatted titles (T122976)
$heading.text( docOrMsg.title || mw.Title.newFromText( ve.init.target.getPageName() ).getPrefixedText() ),
$redirect,
$( '<div>' ).addClass( 'mw-content-' + mw.config.get( 'wgVisualEditor' ).pageLanguageDir ).append(
contents
body.childNodes
)
);