diff --git a/packages/bbob-parser/test/parse.test.ts b/packages/bbob-parser/test/parse.test.ts index 3478ac9f..ec558cac 100644 --- a/packages/bbob-parser/test/parse.test.ts +++ b/packages/bbob-parser/test/parse.test.ts @@ -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: '>' }); diff --git a/packages/bbob-preset-html5/test/index.test.ts b/packages/bbob-preset-html5/test/index.test.ts index 3eab8b26..9d82ce8a 100644 --- a/packages/bbob-preset-html5/test/index.test.ts +++ b/packages/bbob-preset-html5/test/index.test.ts @@ -55,6 +55,13 @@ describe('@bbob/preset-html5', () => { expect(parse(input)).toBe(result); }); + test('[img]https://tw.greywool.com/i/e3Ph5.png[/img]', () => { + const input = '[img]https://tw.greywool.com/i/e3Ph5.png[/img]'; + const result = ''; + + expect(parse(input)).toBe(result); + }); + test('[quote="author"]quoted text[/quote]', () => { const input = '[quote="author"]quoted text[/quote]'; const result = '

quoted text

';