mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
New static property - renderHtmlAttributes
It is going to be used at least for figure tags for which Parsoid gives as a lot of CSS class names that are useless for rendering purpose Change-Id: I4b1e8084a6b7ab5294e0c3cf153fc6cffb3e8dac
This commit is contained in:
parent
e7ee9564e6
commit
2286259681
|
@ -26,11 +26,13 @@ ve.ce.View = function VeCeView( model, $element ) {
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
this.$.data( 'view', this );
|
this.$.data( 'view', this );
|
||||||
ve.setDomAttributes(
|
if ( this.constructor.static.renderHtmlAttributes ) {
|
||||||
this.$[0],
|
ve.setDomAttributes(
|
||||||
this.model.getAttributes( 'html/0/' ),
|
this.$[0],
|
||||||
this.constructor.static.domAttributeWhitelist
|
this.model.getAttributes( 'html/0/' ),
|
||||||
);
|
this.constructor.static.domAttributeWhitelist
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Inheritance */
|
/* Inheritance */
|
||||||
|
@ -71,6 +73,16 @@ ve.ce.View.static.domAttributeWhitelist = [
|
||||||
'summary', 'title', 'type', 'typeof', 'valign', 'value', 'width'
|
'summary', 'title', 'type', 'typeof', 'valign', 'value', 'width'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not HTML attributes listed in domAttributeWhitelist and present in HTMLDOM should be
|
||||||
|
* added to node anchor (this.$).
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @property static.renderHtmlAttributes
|
||||||
|
* @inheritable
|
||||||
|
*/
|
||||||
|
ve.ce.View.static.renderHtmlAttributes = true;
|
||||||
|
|
||||||
/* Methods */
|
/* Methods */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue