Skip to content

Commit 7fbe257

Browse files
committed
prevent emoji being formatted
1 parent 67f55e9 commit 7fbe257

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/__tests__/parseExpensiMark.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ test('emoji', () => {
7070
expect('Hello, 😎').toBeParsedAs([{type: 'emoji', start: 7, length: 2}]);
7171
});
7272

73+
test('emoji and italic', () => {
74+
expect('_😎_').toBeParsedAs([
75+
{type: 'syntax', start: 0, length: 1},
76+
{type: 'italic', start: 1, length: 2},
77+
{type: 'emoji', start: 1, length: 2},
78+
{type: 'syntax', start: 3, length: 1},
79+
]);
80+
});
81+
7382
describe('mention-here', () => {
7483
test('normal', () => {
7584
expect('@here Hello!').toBeParsedAs([{type: 'mention-here', start: 0, length: 5}]);

src/rangeUtils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import type {MarkdownRange, MarkdownType} from './commonTypes';
66
function getTagPriority(tag: string) {
77
switch (tag) {
88
case 'blockquote':
9-
return 2;
9+
return 3;
1010
case 'h1':
11-
return 1;
12-
default:
11+
return 2;
12+
case 'emoji':
1313
return 0;
14+
default:
15+
return 1;
1416
}
1517
}
1618

0 commit comments

Comments
 (0)