| ... | @@ -94,7 +94,7 @@ describe('GfmAutoComplete', () => { |
... | @@ -94,7 +94,7 @@ describe('GfmAutoComplete', () => { |
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('should quote if value contains any non-alphanumeric characters', () => {
|
|
it('should quote if value contains any non-alphanumeric characters', () => {
|
|
|
expect(beforeInsert(atwhoInstance, '~label-20')).toBe('~"label\\-20"');
|
|
expect(beforeInsert(atwhoInstance, '~label-20')).toBe('~"label-20"');
|
|
|
expect(beforeInsert(atwhoInstance, '~label 20')).toBe('~"label 20"');
|
|
expect(beforeInsert(atwhoInstance, '~label 20')).toBe('~"label 20"');
|
|
|
});
|
|
});
|
|
|
|
|
|
| ... | @@ -102,12 +102,21 @@ describe('GfmAutoComplete', () => { |
... | @@ -102,12 +102,21 @@ describe('GfmAutoComplete', () => { |
|
|
expect(beforeInsert(atwhoInstance, '~1234')).toBe('~"1234"');
|
|
expect(beforeInsert(atwhoInstance, '~1234')).toBe('~"1234"');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('should escape Markdown emphasis characters, except in the first character', () => {
|
|
it('escapes Markdown strikethroughs when needed', () => {
|
|
|
expect(beforeInsert(atwhoInstance, '@_group')).toEqual('@\\_group');
|
|
expect(beforeInsert(atwhoInstance, '~a~bug')).toEqual('~"a~bug"');
|
|
|
expect(beforeInsert(atwhoInstance, '~_bug')).toEqual('~\\_bug');
|
|
expect(beforeInsert(atwhoInstance, '~a~~bug~~')).toEqual('~"a\\~~bug\\~~"');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('escapes Markdown emphasis when needed', () => {
|
|
|
|
expect(beforeInsert(atwhoInstance, '~a_bug_')).toEqual('~a_bug\\_');
|
|
|
|
expect(beforeInsert(atwhoInstance, '~a _bug_')).toEqual('~"a \\_bug\\_"');
|
|
|
|
expect(beforeInsert(atwhoInstance, '~a*bug*')).toEqual('~"a\\*bug\\*"');
|
|
|
|
expect(beforeInsert(atwhoInstance, '~a *bug*')).toEqual('~"a \\*bug\\*"');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('escapes Markdown code spans when needed', () => {
|
|
|
|
expect(beforeInsert(atwhoInstance, '~a`bug`')).toEqual('~"a\\`bug\\`"');
|
|
|
expect(beforeInsert(atwhoInstance, '~a `bug`')).toEqual('~"a \\`bug\\`"');
|
|
expect(beforeInsert(atwhoInstance, '~a `bug`')).toEqual('~"a \\`bug\\`"');
|
|
|
expect(beforeInsert(atwhoInstance, '~a ~bug')).toEqual('~"a \\~bug"');
|
|
|
|
|
expect(beforeInsert(atwhoInstance, '~a **bug')).toEqual('~"a \\*\\*bug"');
|
|
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |