Skip to content

Commit 505b685

Browse files
committed
take into account possible CRLF endings in the regex in build/emoji.js just in case it runs in Windows and line endings happen to be CRLF
1 parent 4f62eb8 commit 505b685

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build/emoji.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ function writeEmojiPage(emojiData) {
4242
const emojiPage =
4343
(isExistingPage && fs.readFileSync(filePaths.emojiMarkdown, 'utf8')) ||
4444
`<!-- START -->\n\n<!-- END -->`;
45-
const emojiRegEx = /(<!--\s*START.*-->\n)([\s\S]*)(\n<!--\s*END.*-->)/;
45+
const emojiRegEx = /(<!--\s*START.*-->\r?\n)([\s\S]*)(\r?\n<!--\s*END.*-->)/;
46+
// ^ Note, we use \r? in case Windows converts to CRLF
4647
const emojiMatch = emojiPage.match(emojiRegEx);
4748
const emojiMarkdownStart = emojiMatch[1].trim();
4849
const emojiMarkdown = emojiMatch[2].trim();

0 commit comments

Comments
 (0)