Browse Source

Improve tbody for xml parser

pull/3691/head
Artur Arseniev 5 years ago
parent
commit
76e77ee29c
  1. 17
      src/dom_components/model/ComponentTableBody.js
  2. 4
      test/specs/dom_components/model/ComponentTypes.js

17
src/dom_components/model/ComponentTableBody.js

@ -1,11 +1,14 @@
import Component from './Component';
import { toLowerCase } from 'utils/mixins';
const type = 'tbody';
export default Component.extend(
{
defaults: {
...Component.prototype.defaults,
type: 'tbody',
tagName: 'tbody',
type,
tagName: type,
draggable: ['table'],
droppable: ['tr'],
columns: 1,
@ -45,14 +48,6 @@ export default Component.extend(
}
},
{
isComponent(el) {
let result = '';
if (el.tagName == 'TBODY') {
result = { type: 'tbody' };
}
return result;
}
isComponent: el => toLowerCase(el.tagName) === type
}
);

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

@ -44,6 +44,10 @@ describe('Component Types', () => {
expectedType('<table></table>', 'table', { skipHtml: 1 });
});
test('<tbody> is correctly recognized', () => {
expectedType('<tbody></tbody>', 'tbody', { skipHtml: 1 });
});
test('<script> is correctly recognized', () => {
// const scr = 'console.log("Inline script");'; // issues with jsdom parser
const scr = ``;

Loading…
Cancel
Save