mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-25 15:35:13 +00:00
Add link tests
This commit is contained in:
parent
2863322d4c
commit
916ee3e012
1 changed files with 22 additions and 0 deletions
|
@ -756,6 +756,28 @@ describe('FullParser', () => {
|
||||||
];
|
];
|
||||||
assert.deepStrictEqual(mfm.parse(input), output);
|
assert.deepStrictEqual(mfm.parse(input), output);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('with brackets', () => {
|
||||||
|
const input = '[foo](https://example.com/foo(bar))';
|
||||||
|
const output = [
|
||||||
|
LINK(false, 'https://example.com/foo(bar)', [
|
||||||
|
TEXT('foo')
|
||||||
|
]),
|
||||||
|
];
|
||||||
|
assert.deepStrictEqual(mfm.parse(input), output);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('with parent brackets', () => {
|
||||||
|
const input = '([foo](https://example.com/foo(bar)))';
|
||||||
|
const output = [
|
||||||
|
TEXT('('),
|
||||||
|
LINK(false, 'https://example.com/foo(bar)', [
|
||||||
|
TEXT('foo')
|
||||||
|
]),
|
||||||
|
TEXT(')'),
|
||||||
|
];
|
||||||
|
assert.deepStrictEqual(mfm.parse(input), output);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('fn v1', () => {
|
describe('fn v1', () => {
|
||||||
|
|
Loading…
Reference in a new issue