Skip to content

Commit

Permalink
Update regex for Emoji 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecked committed May 8, 2020
1 parent f5dfa9e commit d1ea6cc
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 7 deletions.
8 changes: 4 additions & 4 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
node_module(
sources = rglobs(
sources = [
".babelrc",
".eslintignore",
".eslintrc",
".flowconfig",
"scripts/*",
"src/*",
"jest.config.js",
"package.json",
"scripts/**/*",
"src/**/*",
"yarn.lock",
),
],
package_manager = "yarn",
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ in all interactions with the community.
Create a [new issue](https://github.com/twitter/twemoji-parser/issues/new) on GitHub.

## Security Issues?
Please report sensitive security issues via Twitter's [bug-bounty program](https://hackerone.com/twitter) rather than GitHub.
Please report sensitive security issues via Twitter's bug-bounty program (https://hackerone.com/twitter) rather than GitHub.

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"license": "MIT",
"name": "twemoji-parser",
"version": "12.1.3",
"version": "13.0.0",
"description": "Parser for identifying Twemoji in text",
"main": "dist/index.js",
"files": [
Expand Down
57 changes: 57 additions & 0 deletions src/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ describe('version spot checks', () => {
}
]);
});

describe('trans symbol', () => {
test('with vs16', () => {
expect(parse('\u26a7\ufe0f')).toMatchObject([
Expand Down Expand Up @@ -652,4 +653,60 @@ describe('version spot checks', () => {
}
});
});

describe('Emoji 13.0', () => {
test('Mx Claus', () => {
expect(parse('\ud83e\uddd1\u200d\ud83c\udf84')).toMatchObject([
{
indices: [0, 5],
text: '\ud83e\uddd1\u200d\ud83c\udf84'
}
]);
});

test('black cat', () => {
expect(parse('\ud83d\udc08\u200d\u2b1b')).toMatchObject([
{
indices: [0, 4],
text: '\ud83d\udc08\u200d\u2b1b'
}
]);
});

test('polar bear', () => {
expect(parse('\ud83d\udc3b\u200d\u2744\ufe0f')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\udc3b\u200d\u2744\ufe0f'
}
]);
});

test('woman feeding baby', () => {
expect(parse('\ud83d\udc69\u200d\ud83c\udf7c')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\udc69\u200d\ud83c\udf7c'
}
]);
});

test('man feeding baby', () => {
expect(parse('\ud83d\udc68\u200d\ud83c\udf7c')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\udc68\u200d\ud83c\udf7c'
}
]);
});

test('person feeding baby', () => {
expect(parse('\ud83e\uddd1\u200d\ud83c\udf7c')).toMatchObject([
{
indices: [0, 5],
text: '\ud83e\uddd1\u200d\ud83c\udf7c'
}
]);
});
});
});
2 changes: 1 addition & 1 deletion src/lib/regex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1ea6cc

Please sign in to comment.