Skip to content

Commit

Permalink
Revert "understand other URL schemes too (misskey-dev#73)"
Browse files Browse the repository at this point in the history
This reverts commit a731592.
  • Loading branch information
sousuke0422 authored Aug 23, 2021
1 parent d073c8c commit 13df240
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
10 changes: 0 additions & 10 deletions src/internal/parser.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,6 @@ altUrlFormat
{
return text();
}
// URL scheme as defined in https://url.spec.whatwg.org/#url-scheme-string
/ [a-zA-Z] [-a-zA-Z0-9+.]* ":" (!(">" / _) CHAR)+
{
return text();
}

// inline: link

Expand All @@ -417,11 +412,6 @@ linkLabelPart

linkUrl
= url { return text(); }
// URL scheme as defined in https://url.spec.whatwg.org/#url-scheme-string
/ [a-zA-Z] [-a-zA-Z0-9+.]* ":" (!(")" / _) CHAR)+
{
return text();
}

// inline: fn

Expand Down
26 changes: 0 additions & 26 deletions test/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -882,22 +882,6 @@ 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', () => {
Expand Down Expand Up @@ -978,16 +962,6 @@ 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', () => {
Expand Down

0 comments on commit 13df240

Please sign in to comment.