fix(escapeX): emojis with underlines (#8945)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Almeida
2022-12-25 20:04:26 +00:00
committed by GitHub
parent 36560c9955
commit 07b597df16
2 changed files with 16 additions and 2 deletions

View File

@@ -58,6 +58,13 @@ describe('escapeItalic', () => {
test('basic (*)', () => {
expect(Util.escapeItalic('*test*')).toEqual('\\*test\\*');
});
test('emoji', () => {
const testOne = 'This is a test with _emojis_ <:Frost_ed_Wreath:1053399941210443826> and **bold text**.';
expect(Util.escapeItalic(testOne)).toEqual(
'This is a test with \\_emojis\\_ <:Frost_ed_Wreath:1053399941210443826> and **bold text**.',
);
});
});
describe('escapeUnderline', () => {
@@ -70,6 +77,13 @@ describe('escapeUnderline', () => {
test('basic', () => {
expect(Util.escapeUnderline('__test__')).toEqual('\\_\\_test\\_\\_');
});
test('emoji', () => {
const testTwo = 'This is a test with __emojis__ <:Frost__ed__Wreath:1053399939654352978> and **bold text**.';
expect(Util.escapeUnderline(testTwo)).toBe(
'This is a test with \\_\\_emojis\\_\\_ <:Frost__ed__Wreath:1053399939654352978> and **bold text**.',
);
});
});
describe('escapeStrikethrough', () => {