mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-23 20:40:34 +03:00
* fix(preset-html5): add color tag #189 * fix(parser): case insensitive tags bug #190
This commit is contained in:
@@ -87,4 +87,5 @@ export default {
|
||||
|
||||
return toNode(type ? 'ol' : 'ul', type ? { type } : {}, asListItems(node.content));
|
||||
},
|
||||
color: (node) => toNode('span', toStyle(`color: ${getUniqAttr(node.attrs)};`), node.content),
|
||||
};
|
||||
|
||||
@@ -77,6 +77,13 @@ describe('@bbob/preset-html5', () => {
|
||||
expect(parse(input)).toBe(result);
|
||||
});
|
||||
|
||||
test('[color="red"]Red Text[/color]', () => {
|
||||
const input = '[color="red"]Red Text[/color]';
|
||||
const result = '<span style="color: red;">Red Text</span>';
|
||||
|
||||
expect(parse(input)).toBe(result);
|
||||
});
|
||||
|
||||
test(`[list][*]Entry 1[/list]`, () => {
|
||||
const input = `[list][*]Entry 1[*]Entry 2[/list]`;
|
||||
const result = '<ul><li>Entry 1</li><li>Entry 2</li></ul>';
|
||||
|
||||
Reference in New Issue
Block a user