-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
understand other URL schemes too (#73)
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -882,6 +882,22 @@ hoge`; | |
]; | ||
assert.deepStrictEqual(mfm.parse(input), output); | ||
}); | ||
|
||
it('do not match other schemes in url withouth angle brackets', () => { | ||
const input = 'oops:url'; | ||
const output = [ | ||
TEXT('oops:url'), | ||
]; | ||
assert.deepStrictEqual(mfm.parse(input), output); | ||
}); | ||
|
||
it('match other schemes in url with angle brackets', () => { | ||
const input = '<gemini://example.com>'; | ||
const output = [ | ||
N_URL('gemini://example.com', true), | ||
]; | ||
assert.deepStrictEqual(mfm.parse(input), output); | ||
}); | ||
}); | ||
|
||
describe('link', () => { | ||
|
@@ -962,6 +978,16 @@ hoge`; | |
]; | ||
assert.deepStrictEqual(mfm.parse(input), output); | ||
}); | ||
|
||
it('match other schemes without angle brackets', () => { | ||
const input = '[send email](mailto:[email protected]?subject=test)'; | ||
const output = [ | ||
LINK(false, 'mailto:[email protected]?subject=test', [ | ||
TEXT('send email') | ||
]), | ||
]; | ||
assert.deepStrictEqual(mfm.parse(input), output); | ||
}); | ||
}); | ||
|
||
describe('fn v1', () => { | ||
|