mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-21 21:55:09 +00:00
parent
238ac6b901
commit
d037c2780a
2 changed files with 13 additions and 5 deletions
|
@ -402,9 +402,9 @@ altUrlFormat
|
|||
// inline: link
|
||||
|
||||
link
|
||||
= silent:"?"? "[" label:linkLabel "](" url:linkUrl ")"
|
||||
= silent:"?"? "[" label:linkLabel "](" url:url ")"
|
||||
{
|
||||
return LINK((silent != null), url, mergeText(label));
|
||||
return LINK((silent != null), url.props.url, mergeText(label));
|
||||
}
|
||||
|
||||
linkLabel
|
||||
|
@ -416,9 +416,6 @@ linkLabelPart
|
|||
/ mention { return text(); /* text node */ }
|
||||
/ !"]" @inline
|
||||
|
||||
linkUrl
|
||||
= url { return text(); }
|
||||
|
||||
// inline: fn
|
||||
|
||||
fn
|
||||
|
|
|
@ -961,6 +961,17 @@ hoge`;
|
|||
assert.deepStrictEqual(mfm.parse(input), output);
|
||||
});
|
||||
|
||||
it('with angle brackets url', () => {
|
||||
const input = '[official instance](<https://misskey.io/@ai>).';
|
||||
const output = [
|
||||
LINK(false, 'https://misskey.io/@ai', [
|
||||
TEXT('official instance')
|
||||
]),
|
||||
TEXT('.')
|
||||
];
|
||||
assert.deepStrictEqual(mfm.parse(input), output);
|
||||
});
|
||||
|
||||
it('do not yield url node even if label is recognisable as a url', () => {
|
||||
const input = 'official instance: [https://misskey.io/@ai](https://misskey.io/@ai).';
|
||||
const output = [
|
||||
|
|
Loading…
Reference in a new issue