From dcddddc85ac224f3fb74cd30f80fd3f2564dee32 Mon Sep 17 00:00:00 2001
From: Purexo <5005154+Purexo@users.noreply.github.com>
Date: Fri, 17 May 2024 11:49:45 +0200
Subject: [PATCH] fix: support emoji modifier
---
src/format-checkers/Link.ts | 2 +-
src/format-checkers/Project.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/format-checkers/Link.ts b/src/format-checkers/Link.ts
index c32a2c2..5354d7c 100644
--- a/src/format-checkers/Link.ts
+++ b/src/format-checkers/Link.ts
@@ -2,7 +2,7 @@ import { FormatChecker } from '../framework/index.js';
const urlRegexp =
'?';
-const titleRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:)|(?::\\w{2,32}:)|\\p{Emoji_Presentation})+`;
+const titleRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:)|(?::\\w{2,32}:)|(?:\\p{Emoji_Presentation}\\p{Emoji_Modifier}*))+`;
const linkRegexp = `^\\[( )?(\\*\\*)?${titleRegexp}\\2\\1\\](?:[^\\n])+ - ${urlRegexp}$`;
export default new FormatChecker({
diff --git a/src/format-checkers/Project.ts b/src/format-checkers/Project.ts
index d5995be..e4f4469 100644
--- a/src/format-checkers/Project.ts
+++ b/src/format-checkers/Project.ts
@@ -2,7 +2,7 @@ import { FormatChecker } from '../framework/index.js';
const urlRegexp =
'?';
-const headerRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:)|(?::\\w{2,32}:)|\\p{Emoji_Presentation})+`;
+const headerRegexp = `(?:[a-zA-Z0-9_\\- ]|(?:)|(?::\\w{2,32}:)|(?:\\p{Emoji_Presentation}\\p{Emoji_Modifier}*))+`;
const projectRegexp = new RegExp(
`^\\*\\*${headerRegexp}+\\*\\*\\n\\n(?:.*\\n)+\n(?:(?:${headerRegexp}* )?${urlRegexp}\n)+$`,
'u',