mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-25 15:35:13 +00:00
parses the link in the link node as text node.
This commit is contained in:
parent
207134be21
commit
0ecd1de57c
2 changed files with 13 additions and 0 deletions
|
@ -343,6 +343,7 @@ link
|
|||
|
||||
linkLabelPart
|
||||
= url { return text(); /* text node */ }
|
||||
/ link { return text(); /* text node */ }
|
||||
/ !"]" n:inline { return n; }
|
||||
|
||||
linkUrl
|
||||
|
|
12
test/main.ts
12
test/main.ts
|
@ -457,6 +457,18 @@ describe('link', () => {
|
|||
];
|
||||
assert.deepStrictEqual(parse(input), output);
|
||||
});
|
||||
|
||||
it('do not yield link node even if label is recognisable as a link', () => {
|
||||
const input = 'official instance: [[https://misskey.io/@ai](https://misskey.io/@ai)](https://misskey.io/@ai).';
|
||||
const output = [
|
||||
TEXT('official instance: '),
|
||||
LINK(false, 'https://misskey.io/@ai', [
|
||||
TEXT('[https://misskey.io/@ai](https://misskey.io/@ai)')
|
||||
]),
|
||||
TEXT('.')
|
||||
];
|
||||
assert.deepStrictEqual(parse(input), output);
|
||||
});
|
||||
});
|
||||
|
||||
describe('fn', () => {
|
||||
|
|
Loading…
Reference in a new issue