Skip to content

Commit

Permalink
fix: support emoji modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Purexo authored and Xstoudi committed May 18, 2024
1 parent f552cba commit dcddddc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/format-checkers/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FormatChecker } from '../framework/index.js';

const urlRegexp =
'<?https?:\\/\\/(?:www\\.)?[-\\w@:%.\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-\\w()@:%\\+.~#?&//=]*)>?';
const titleRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:<a?:\\w{2,32}:\\d{17,20}>)|(?::\\w{2,32}:)|\\p{Emoji_Presentation})+`;
const titleRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:<a?:\\w{2,32}:\\d{17,20}>)|(?::\\w{2,32}:)|(?:\\p{Emoji_Presentation}\\p{Emoji_Modifier}*))+`;
const linkRegexp = `^\\[( )?(\\*\\*)?${titleRegexp}\\2\\1\\](?:[^\\n])+ - ${urlRegexp}$`;

export default new FormatChecker({
Expand Down
2 changes: 1 addition & 1 deletion src/format-checkers/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FormatChecker } from '../framework/index.js';

const urlRegexp =
'<?https?:\\/\\/(?:www\\.)?[-\\w@:%.\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-\\w()@:%\\+.~#?&//=]*)>?';
const headerRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:<a?:\\w{2,32}:\\d{17,20}>)|(?::\\w{2,32}:)|\\p{Emoji_Presentation})+`;
const headerRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:<a?:\\w{2,32}:\\d{17,20}>)|(?::\\w{2,32}:)|(?:\\p{Emoji_Presentation}\\p{Emoji_Modifier}*))+`;
const projectRegexp = new RegExp(
`^\\*\\*${headerRegexp}+\\*\\*\\n\\n(?:.*\\n)+\n(?:(?:${headerRegexp}* )?${urlRegexp}\n)+$`,
'u',
Expand Down

0 comments on commit dcddddc

Please sign in to comment.