Skip to content

Commit a5bf023

Browse files
Fix regex
1 parent b4614b1 commit a5bf023

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/graphql/repoQuestions.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
//const url = "https://raw.githubusercontent.com/Ditectrev/Microsoft-Azure-AZ-900-Microsoft-Azure-Fundamentals-Exam-Questions-Answers/main/README.md";
2-
31
const scrapeQuestions = (markdownText: string) => {
42
const regex =
5-
/### (.*?)\s*\n\n((?:\!\[.*?\]\(.*?\)\s*\n\n)*?)((?:- \[(?:x| )\] .*?\n)+)/gs;
6-
const optionsRegex = /- \[(x| )\] (.*?)(?=\n- \[|$)/g;
3+
/### (.*?)\s*\r?\n\r?\n((?:\!\[.*?\]\(.*?\)\s*\r?\n\r?\n)*?)((?:- \[(?:x| )\] .*?\r?\n)+)/gs;
4+
5+
const optionsRegex = /- \[(x| )\] (.*?)(?=\r?\n- \[|$)/g;
76
const imageRegex = /\!\[(.*?)\]\((.*?)\)/g;
87
const questions = [];
98
let match;

0 commit comments

Comments
 (0)