2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-17 19:21:20 +03:00

feat(parser): custom open and close tags support, html tags tests (#3)

This commit is contained in:
Nikolay Kostyurin
2018-09-18 23:41:52 +02:00
committed by GitHub
parent f5fd078eca
commit 790825af30
9 changed files with 268 additions and 100 deletions
+3 -4
View File
@@ -3,16 +3,15 @@ import {render} from '../src';
const process = (input, params) => {
const ast = parse(input);
const html = render(ast, params);
return html
return render(ast, params)
};
describe('@bbob/html', () => {
test('render bbcode tag with single param as html tag', () => {
const input = '[url=https://ru.wikipedia.org]Text[/url]';
const expected = '<url url="https://ru.wikipedia.org">Text</url>';
const result = process(input)
const expected = '<url https://ru.wikipedia.org="https://ru.wikipedia.org">Text</url>';
const result = process(input);
expect(result).toBe(expected);
});