Skip to content

Commit

Permalink
Merge branch 'unhide-build-errors' into tmp-fix-for-windows.
Browse files Browse the repository at this point in the history
This is a temporary commit until docsifyjs#2288 and docsifyjs#2291 are merged to Docsify develop, so that I can get Lume build working in Windows (which includes Docsify for the docs site)
  • Loading branch information
trusktr committed Oct 22, 2023
2 parents f065f98 + 76334a9 commit 3b2e3a3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions build/emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ function writeEmojiPage(emojiData) {
const emojiPage =
(isExistingPage && fs.readFileSync(filePaths.emojiMarkdown, 'utf8')) ||
`<!-- START -->\n\n<!-- END -->`;
const emojiRegEx = /(<!--\s*START.*-->\n)([\s\S]*)(\n<!--\s*END.*-->)/;
const emojiRegEx = /(<!--\s*START.*-->\r?\n)([\s\S]*)(\r?\n<!--\s*END.*-->)/;
// ^ Note, we use \r? in case Windows converts to CRLF
const emojiMatch = emojiPage.match(emojiRegEx);
const emojiMarkdownStart = emojiMatch[1].trim();
const emojiMarkdown = emojiMatch[2].trim();
Expand Down Expand Up @@ -95,13 +96,9 @@ function writeEmojiJS(emojiData) {

console.info('Build emoji');

try {
const emojiData = await getEmojiData();
const emojiData = await getEmojiData();

if (emojiData) {
writeEmojiPage(emojiData);
writeEmojiJS(emojiData);
}
} catch (err) {
console.warn(`- Error: ${err.message}`);
if (emojiData) {
writeEmojiPage(emojiData);
writeEmojiJS(emojiData);
}

0 comments on commit 3b2e3a3

Please sign in to comment.