Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js |
— | — | @@ -488,7 +488,7 @@ |
489 | 489 | * @method |
490 | 490 | * @returns {Object} Plain object representation |
491 | 491 | */ |
492 | | -es.DocumentModel.expandContentData = function( data ) { |
| 492 | +es.DocumentModel.getExpandedContentData = function( data ) { |
493 | 493 | var stack = []; |
494 | 494 | // Text and annotations |
495 | 495 | function start( offset, annotation ) { |
Index: trunk/extensions/VisualEditor/modules/es/serializers/es.HtmlSerializer.js |
— | — | @@ -38,6 +38,21 @@ |
39 | 39 | return count ? htmlAttributes : null; |
40 | 40 | }; |
41 | 41 | |
| 42 | +es.HtmlSerializer.getExpandedListItems = function( node ) { |
| 43 | + var styles, |
| 44 | + levels = []; |
| 45 | + for ( var i = 0; i < this.children.length; i++ ) { |
| 46 | + styles = this.children[i].model.getElementAttribute( 'styles' ); |
| 47 | + levels = levels.slice( 0, styles.length ); |
| 48 | + if ( styles[styles.length - 1] === 'number' ) { |
| 49 | + if ( !levels[styles.length - 1] ) { |
| 50 | + levels[styles.length - 1] = 0; |
| 51 | + } |
| 52 | + this.children[i].setNumber( ++levels[styles.length - 1] ); |
| 53 | + } |
| 54 | + } |
| 55 | +}; |
| 56 | + |
42 | 57 | /* Methods */ |
43 | 58 | |
44 | 59 | es.HtmlSerializer.prototype.document = function( node, rawFirstParagraph ) { |
Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentModelNode.js |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | obj.children.push( this.children[i].getPlainObject() ); |
77 | 77 | } |
78 | 78 | } else if ( this.getContentLength() ) { |
79 | | - obj.content = es.DocumentModel.expandContentData( this.getContent() ); |
| 79 | + obj.content = es.DocumentModel.getExpandedContentData( this.getContent() ); |
80 | 80 | } |
81 | 81 | return obj; |
82 | 82 | }; |