mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-11 18:02:26 +03:00
chore(benchmark): add ya-bbcode as benchmark target in benchmark suite (#62)
This commit is contained in:
committed by
GitHub
parent
97ecba0af6
commit
22237c4500
Vendored
+15
-6
@@ -9,16 +9,25 @@ suite
|
||||
closable: true,
|
||||
},
|
||||
}))
|
||||
.add('ya-bbcode', () => {
|
||||
const Yabbcode = require('ya-bbcode');
|
||||
const parser = new Yabbcode();
|
||||
|
||||
parser.clearTags();
|
||||
parser.registerTag('ch', {
|
||||
type: 'replace',
|
||||
open: () => '<div>',
|
||||
close: () => '</div>',
|
||||
});
|
||||
|
||||
return parser.parse(stub);
|
||||
})
|
||||
.add('xbbcode/parser', () => {
|
||||
const xbbcode = require('xbbcode-parser');
|
||||
xbbcode.addTags({
|
||||
ch: {
|
||||
openTag(params, content) {
|
||||
return '<div>';
|
||||
},
|
||||
closeTag(params, content) {
|
||||
return '</div>';
|
||||
},
|
||||
openTag: () => '<div>',
|
||||
closeTag: () => '</div>',
|
||||
restrictChildrenTo: [],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user