Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js |
— | — | @@ -137,8 +137,6 @@ |
138 | 138 | 'references': MWReferencesTagHook |
139 | 139 | } |
140 | 140 | }); |
141 | | - // XXX: hack |
142 | | - tree.children = tree.content; |
143 | 141 | var res = es.HtmlSerializer.stringify(tree,environment); |
144 | 142 | if (err) { |
145 | 143 | console.log('RENDER FAIL', err); |
Index: trunk/extensions/VisualEditor/modules/es/serializers/es.HtmlSerializer.js |
— | — | @@ -100,10 +100,10 @@ |
101 | 101 | var minLength = Math.min(x.length, y.length); |
102 | 102 | for(var i = 0; i < minLength; i++) { |
103 | 103 | if (x[i] !== y[i]) { |
104 | | - // Both definitiondata and definitionterm are |
| 104 | + // Both definitiondescription and definitionterm are |
105 | 105 | // inside dls, so consider them equivalent here. |
106 | 106 | var diffs = [x[i], y[i]].sort(); |
107 | | - if (diffs[0] !== 'definitiondata' |
| 107 | + if (diffs[0] !== 'definitiondescription' |
108 | 108 | && diffs[1] !== 'definitionterm' ) { |
109 | 109 | break; |
110 | 110 | } |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | closeTags.push(es.Html.makeClosingTag('ol')); |
136 | 136 | break; |
137 | 137 | case 'definitionterm': |
138 | | - case 'definitiondata': |
| 138 | + case 'definitiondescription': |
139 | 139 | out.push(es.Html.makeOpeningTag('dl', attribs)); |
140 | 140 | closeTags.push(es.Html.makeClosingTag('dl')); |
141 | 141 | break; |
— | — | @@ -144,8 +144,7 @@ |
145 | 145 | }; |
146 | 146 | } |
147 | 147 | |
148 | | - var childrenLength = node.children.length; |
149 | | - for (var i = 0; i < childrenLength; i++) { |
| 148 | + for (var i = 0, length = node.children.length; i < length; i++) { |
150 | 149 | var e = node.children[i]; |
151 | 150 | bnext = e.attributes.styles; |
152 | 151 | delete e.attributes['styles']; |
— | — | @@ -154,7 +153,7 @@ |
155 | 154 | switch(bnext[bnext.length - 1]) { |
156 | 155 | case 'definitionterm': |
157 | 156 | tag = 'dt'; break; |
158 | | - case 'definitiondata': |
| 157 | + case 'definitiondescription': |
159 | 158 | tag = 'dd'; break; |
160 | 159 | default: |
161 | 160 | tag = 'li'; break; |
Index: trunk/extensions/VisualEditor/modules/es/serializers/es.WikitextSerializer.js |
— | — | @@ -79,7 +79,9 @@ |
80 | 80 | es.WikitextSerializer.prototype.list = function( node ) { |
81 | 81 | var symbolTable = { |
82 | 82 | 'bullet': '*', |
83 | | - 'number': '#' |
| 83 | + 'number': '#', |
| 84 | + 'definitionterm': ';', |
| 85 | + 'definitiondescription': ':' |
84 | 86 | }; |
85 | 87 | function convertStyles( styles ) { |
86 | 88 | var symbols = ''; |
Index: trunk/extensions/VisualEditor/modules/parser/pegParser.pegjs.txt |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | case ';': |
97 | 97 | bTypes.push('definitionterm'); break; |
98 | 98 | case ':': |
99 | | - bTypes.push('definitiondata'); break; |
| 99 | + bTypes.push('definitiondescription'); break; |
100 | 100 | } |
101 | 101 | } |
102 | 102 | return bTypes; |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | dp(es); |
117 | 117 | return { |
118 | 118 | type: 'page', |
119 | | - content: es |
| 119 | + children: es |
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
— | — | @@ -313,6 +313,7 @@ |
314 | 314 | return out; |
315 | 315 | } |
316 | 316 | |
| 317 | +// TODO: convert all these to annotations! |
317 | 318 | inline_element |
318 | 319 | = comment |
319 | 320 | / xmlish_tag |