mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +03:00
test(parser): add posthtml integration test
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# @bbob/parser
|
||||
[](https://packagephobia.now.sh/result?p=@bbob/parser) [](https://snyk.io/test/github/JiLiZART/bbob?targetFile=packages%2Fbbob-parser%2Fpackage.json)
|
||||
|
||||
Parses BBCode and returns AST Tree
|
||||
> Parses BBCode and returns array AST tree
|
||||
|
||||
Valid for use with [posthtml-render](https://github.com/posthtml/posthtml-render)
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
const render = require('posthtml-render');
|
||||
const parse = require('../lib');
|
||||
|
||||
describe('posthtml-render', () => {
|
||||
|
||||
it('render AST to html', () => {
|
||||
const ast = parse('[size=150][b]PostHTML render test[/b][/size]');
|
||||
const html = render(ast);
|
||||
|
||||
expect(html).toBe('<size size="150"><b>PostHTML render test</b></size>')
|
||||
})
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user