mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-20 20:00:33 +03:00
fix(plugin-helper): better handle content of TagNode
This commit is contained in:
@@ -5,7 +5,7 @@ class TagNode {
|
|||||||
constructor(tag, attrs, content) {
|
constructor(tag, attrs, content) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
this.attrs = attrs;
|
this.attrs = attrs;
|
||||||
this.content = content;
|
this.content = [].concat(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
attr(name, value) {
|
attr(name, value) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
getNodeLength,
|
getNodeLength,
|
||||||
isTagNode,
|
isTagNode,
|
||||||
isStringNode,
|
isStringNode,
|
||||||
|
isEOL,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
describe('@bbob/plugin-helper', () => {
|
describe('@bbob/plugin-helper', () => {
|
||||||
@@ -65,4 +66,8 @@ describe('@bbob/plugin-helper', () => {
|
|||||||
|
|
||||||
expect(attrValue('test', attrs)).toBe('test="{"tag":"test"}"');
|
expect(attrValue('test', attrs)).toBe('test="{"tag":"test"}"');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('isEOL', () => {
|
||||||
|
expect(isEOL('\n')).toBe(true)
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user