2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-08 17:22:26 +03:00

fix: img tag cannot be parsed (#263)

* fix: add img test with url

* fix: add more tests
This commit is contained in:
Nikolay Kost
2024-11-26 16:00:27 +03:00
committed by GitHub
parent 30150d99f9
commit f0c9da683d
2 changed files with 27 additions and 0 deletions
+20
View File
@@ -849,6 +849,26 @@ sdfasdfasdf
);
});
test('parse with url in tag content', () => {
const input = parse('[img]https://tw.greywool.com/i/e3Ph5.png[/img]');
expectOutput(input, [
{
tag: 'img',
attrs: {},
content: ['https://tw.greywool.com/i/e3Ph5.png'],
start: {
from: 0,
to: 5,
},
end: {
from: 40,
to: 46,
},
},
]);
});
describe('html', () => {
const parseHTML = (input: string) => parse(input, { openTag: '<', closeTag: '>' });