2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-11 18:02:26 +03:00

fix(react): rendering self-closed tags and tags without content (#74)

This commit is contained in:
Nikolay Kostyurin
2020-11-16 22:59:08 +02:00
committed by GitHub
parent 9c71bb5f26
commit 5a7211db91
2 changed files with 10 additions and 2 deletions
+6
View File
@@ -43,6 +43,12 @@ describe('@bbob/react', () => {
expect(html).toBe('<span><a href="https://en.wikipedia.org">https://en.wikipedia.org</a></span>')
});
test('[b]Testing[/b][hr]', () => {
const html = renderBBCode('[b]Testing[/b][hr]');
expect(html).toBe('<span><span style="font-weight:bold;">Testing</span><hr/></span>')
});
describe('options.onlyAllowTags', () => {
test('render "[Super Feature] and [i]super[/i]" when only [i] allowed', () => {
const html = renderBBCode('[Super Feature] and [i]super[/i]', { onlyAllowTags: ['i'] });