Skip to content

Commit

Permalink
Add mw-parser-output class to Parsoid's output
Browse files Browse the repository at this point in the history
* Templates will target mw-parser-output
* Skins will target mw-body-content
* There is a large overlap between the targets of the
  two classes, but mw-body-content is also applied to
  interface elements not present in the parser output.

Bug: T37247
Bug: T164792
Change-Id: I05476df24f06a6b06f37a6a22d3e33ef4a939ef8
  • Loading branch information
subbuss authored and jenkins-bot committed May 10, 2017
1 parent 976b895 commit 25a55a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/wt2html/DOMPostProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,16 @@ DOMPostProcessor.addMetaData = function(env, document) {
document.body.setAttribute('dir', dir);

// Set 'mw-body-content' directly on the body.
// This the designated successor for #bodyContent in core skins.
// This is the designated successor for #bodyContent in core skins.
document.body.classList.add('mw-body-content');
// Set 'parsoid-body' to add the desired layout styling from Vector.
document.body.classList.add('parsoid-body');
// Also, add the 'mediawiki' class.
// Some Mediawiki:Common.css seem to target this selector.
document.body.classList.add('mediawiki');
// Set 'mw-parser-output' directly on the body.
// Templates target this class as part of the TemplateStyles RFC
document.body.classList.add('mw-parser-output');
};

DOMPostProcessor.prototype.doPostProcess = function(document) {
Expand Down

0 comments on commit 25a55a5

Please sign in to comment.