Browse Source

Improve table row for xml parser

pull/3691/head
Artur Arseniev 5 years ago
parent
commit
531d7a1a29
  1. 7
      src/dom_components/model/ComponentTableRow.js
  2. 4
      test/specs/dom_components/model/ComponentTypes.js

7
src/dom_components/model/ComponentTableRow.js

@ -1,15 +1,18 @@
import Component from './Component'; import Component from './Component';
import { toLowerCase } from 'utils/mixins';
const tagName = 'tr';
export default Component.extend( export default Component.extend(
{ {
defaults: { defaults: {
...Component.prototype.defaults, ...Component.prototype.defaults,
tagName: 'tr', tagName,
draggable: ['thead', 'tbody', 'tfoot'], draggable: ['thead', 'tbody', 'tfoot'],
droppable: ['th', 'td'] droppable: ['th', 'td']
} }
}, },
{ {
isComponent: el => el.tagName == 'TR' && true isComponent: el => toLowerCase(el.tagName) === tagName
} }
); );

4
test/specs/dom_components/model/ComponentTypes.js

@ -52,6 +52,10 @@ describe('Component Types', () => {
expectedType('<tbody></tbody>', 'tbody', { skipHtml: 1 }); expectedType('<tbody></tbody>', 'tbody', { skipHtml: 1 });
}); });
test('<tr> is correctly recognized', () => {
expectedType('<tr></tr>', 'row');
});
test('<td> & <th> are correctly recognized', () => { test('<td> & <th> are correctly recognized', () => {
expectedType('<td></td>', 'cell'); expectedType('<td></td>', 'cell');
expectedType('<th></th>', 'cell', { total: 2 }); expectedType('<th></th>', 'cell', { total: 2 });

Loading…
Cancel
Save