lib/api/apiUtils.js
function(doc, pb) {
	// Effectively, skip applying data-parsoid.  Note that if we were to
	// support a pb2html downgrade, we'd need to apply the full thing,
	// but that would create complications where ids would be left behind.
	// See the comment in around `DOMDataUtils.applyPageBundle`
	DOMDataUtils.applyPageBundle(doc, { parsoid: { ids: {} }, mw: pb.mw });
	// Now, modify the pagebundle to the expected form.  This is important
	// since, at least in the serialization path, the original pb will be
	// applied to the modified content and its presence could cause lost
	// deletions.
	pb.mw = { ids: {} };
}
function(doc, pb) {
	// Effectively, skip applying data-parsoid.  Note that if we were to
	// support a pb2html downgrade, we'd need to apply the full thing,
	// but that would create complications where ids would be left behind.
	// See the comment in around `DOMDataUtils.applyPageBundle`
	DOMDataUtils.applyPageBundle(doc, { parsoid: { ids: {} }, mw: pb.mw });
	// Now, modify the pagebundle to the expected form.  This is important
	// since, at least in the serialization path, the original pb will be
	// applied to the modified content and its presence could cause lost
	// deletions.
	pb.mw = { ids: {} };
}
function ( doc , pb ) { // Effectively, skip applying data-parsoid.  Note that if we were to // support a pb2html downgrade, we'd need to apply the full thing, // but that would create complications where ids would be left behind. // See the comment in around `DOMDataUtils.applyPageBundle` DOMDataUtils . applyPageBundle ( doc , { parsoid : { ids : { } } , mw : pb . mw } ) ; // Now, modify the pagebundle to the expected form.  This is important // since, at least in the serialization path, the original pb will be // applied to the modified content and its presence could cause lost // deletions. pb . mw = { ids : { } } ; }
Downgrade content from 999.x to 2.x.

@param {Document} doc
@param {Object} pb
Downgrade content from 999 . x to 2 . x .