mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Follow-up to r106208 and r106207. Both good catches, thanks Yair! As this code
is in its early stages and nowhere near deployment, please Be Bold and just commit things like this directly! IMHO it makes more sense to fully review this once it settles down a bit.
This commit is contained in:
parent
3585bd9c8e
commit
e72dee76e4
|
@ -37,20 +37,11 @@ DOMConverter.prototype.getHTMLHandlerInfo = function ( nodeName ) {
|
||||||
case 'h4':
|
case 'h4':
|
||||||
case 'h5':
|
case 'h5':
|
||||||
case 'h6':
|
case 'h6':
|
||||||
var res = {
|
return {
|
||||||
handler: this._convertHTMLLeaf,
|
handler: this._convertHTMLLeaf,
|
||||||
type: 'heading',
|
type: 'heading',
|
||||||
attribs: { }
|
attribs: nodeName.substr(1)
|
||||||
};
|
};
|
||||||
switch ( nodeName.toLowerCase() ) {
|
|
||||||
case 'h1': res.attribs.level = 1; break;
|
|
||||||
case 'h2': res.attribs.level = 2; break;
|
|
||||||
case 'h3': res.attribs.level = 3; break;
|
|
||||||
case 'h4': res.attribs.level = 4; break;
|
|
||||||
case 'h5': res.attribs.level = 5; break;
|
|
||||||
case 'h6': res.attribs.level = 6; break;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
case 'li':
|
case 'li':
|
||||||
case 'dt':
|
case 'dt':
|
||||||
case 'dd':
|
case 'dd':
|
||||||
|
@ -93,11 +84,6 @@ DOMConverter.prototype.getHTMLHandlerInfo = function ( nodeName ) {
|
||||||
handler: this._convertHTMLBranch,
|
handler: this._convertHTMLBranch,
|
||||||
type: 'caption'
|
type: 'caption'
|
||||||
};
|
};
|
||||||
case 'table':
|
|
||||||
return {
|
|
||||||
handler: this._convertHTMLBranch,
|
|
||||||
type: 'table'
|
|
||||||
};
|
|
||||||
case 'hr':
|
case 'hr':
|
||||||
return {
|
return {
|
||||||
handler: this._convertHTMLLeaf,
|
handler: this._convertHTMLLeaf,
|
||||||
|
|
Loading…
Reference in a new issue