r106312 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106311‎ | r106312 | r106313 >
Date:10:13, 15 December 2011
Author:gwicke
Status:deferred
Tags:
Comment:
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.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/parser/mediawiki.DOMConverter.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.DOMConverter.js
@@ -37,20 +37,11 @@
3838 case 'h4':
3939 case 'h5':
4040 case 'h6':
41 - var res = {
 41+ return {
4242 handler: this._convertHTMLLeaf,
4343 type: 'heading',
44 - attribs: { }
 44+ attribs: nodeName.substr(1)
4545 };
46 - switch ( nodeName.toLowerCase() ) {
47 - case 'h1': res.attribs.level = 1; break;
48 - case 'h2': res.attribs.level = 2; break;
49 - case 'h3': res.attribs.level = 3; break;
50 - case 'h4': res.attribs.level = 4; break;
51 - case 'h5': res.attribs.level = 5; break;
52 - case 'h6': res.attribs.level = 6; break;
53 - }
54 - return res;
5546 case 'li':
5647 case 'dt':
5748 case 'dd':
@@ -93,11 +84,6 @@
9485 handler: this._convertHTMLBranch,
9586 type: 'caption'
9687 };
97 - case 'table':
98 - return {
99 - handler: this._convertHTMLBranch,
100 - type: 'table'
101 - };
10288 case 'hr':
10389 return {
10490 handler: this._convertHTMLLeaf,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106207Add implicit level attribute to WikiDom headings.gwicke15:55, 14 December 2011
r106208Handle a few more element types, and reset offset for each leaf node. Not sure...gwicke16:22, 14 December 2011

Status & tagging log