Skip to content

Commit 06c70a0

Browse files
committed
Add more tests to check prefixed scheme URLs issue
1 parent 77d70bf commit 06c70a0

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/autolinker-url.spec.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ describe('Autolinker Url Matching >', () => {
222222
expect(result).toBe(`Link 1;<a href="https://nia.nexon.com">nia.nexon.com</a> testing`);
223223
});
224224

225-
it('should match urls if a URL begins after a numeric character+colon', function () {
225+
it('should match urls if a URL begins after a numeric character+colon (https://github.com/gregjacobs/Autolinker.js/issues/413)', function () {
226226
const result = autolinker.link('Link 1:https://nia.nexon.com testing');
227227

228228
expect(result).toBe(`Link 1:<a href="https://nia.nexon.com">nia.nexon.com</a> testing`);
@@ -234,6 +234,32 @@ describe('Autolinker Url Matching >', () => {
234234
expect(result).toBe(`한글:<a href="https://nia.nexon.com">nia.nexon.com</a> testing`);
235235
});
236236

237+
it('should match urls if a URL begins after a non-latin character+colon (https://github.com/gregjacobs/Autolinker.js/issues/394)', function () {
238+
const result = autolinker.link('链接:https://www.google.com testing');
239+
240+
expect(result).toBe(`链接:<a href="https://www.google.com">www.google.com</a> testing`);
241+
});
242+
243+
it('should match urls if a URL begins after a non-latin character+colon #2 (https://github.com/gregjacobs/Autolinker.js/issues/394)', function () {
244+
const result = autolinker.link('こちら→https://google.com testing');
245+
246+
expect(result).toBe(`こちら→<a href="https://google.com">google.com</a> testing`);
247+
});
248+
249+
it('should match urls if a URL begins after a Persian character (https://github.com/gregjacobs/Autolinker.js/issues/409)', function () {
250+
const result = autolinker.link('این یک لینک استhttps://www.example.com testing');
251+
252+
expect(result).toBe(
253+
`این یک لینک است<a href="https://www.example.com">www.example.com</a> testing`
254+
);
255+
});
256+
257+
it('should match urls if a URL begins after an equals sign (much like an environment var assignment) (https://github.com/gregjacobs/Autolinker.js/issues/405)', function () {
258+
const result = autolinker.link('FOO=https://example.com');
259+
260+
expect(result).toBe(`FOO=<a href="https://example.com">example.com</a>`);
261+
});
262+
237263
it('should match urls with scheme starting with an emoji', function () {
238264
const result = autolinker.link('emoji url 👉http://📙.la/🧛🏻‍♂️ mid-sentence');
239265

0 commit comments

Comments
 (0)