From c51809a471a2aa5c03954a0137024013e0a90689 Mon Sep 17 00:00:00 2001 From: hlane Date: Tue, 24 Feb 2026 18:06:42 -0800 Subject: [PATCH] make component detection of renderContentWithComponents letter case insensitive --- textbook-lib/src/components/TextbookPage.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/textbook-lib/src/components/TextbookPage.jsx b/textbook-lib/src/components/TextbookPage.jsx index 6b53d67..feb1a50 100644 --- a/textbook-lib/src/components/TextbookPage.jsx +++ b/textbook-lib/src/components/TextbookPage.jsx @@ -82,14 +82,14 @@ function renderContentWithComponents(content, textbookPath) { console.log('textbookPath:', textbookPath); // Look for component markers with optional props - const combinedRegex = /\{\{(ExamQuestions|VocabList|ConceptMap|YouTube|ExamBrowser|ProTip|AsAProfessor):([^}\s]+)([^}]*)\}\}/g; + const combinedRegex = /\{\{(ExamQuestions|VocabList|ConceptMap|YouTube|ExamBrowser|ProTip|AsAProfessor):([^}\s]+)([^}]*)\}\}/gi; const parts = []; let lastIndex = 0; let match; while ((match = combinedRegex.exec(content)) !== null) { - const componentType = match[1]; + const componentType = match[1].toLowerCase(); const fileName = match[2]; const propsString = match[3] ? match[3].trim() : ''; console.log(`Found ${componentType} marker:`, match[0], 'File:', fileName, 'Props:', propsString); @@ -156,7 +156,7 @@ function renderContentWithComponents(content, textbookPath) { } // Add the appropriate component - if (componentType === 'ExamQuestions') { + if (componentType === 'examquestions') { parts.push( ); - } else if (componentType === 'VocabList') { + } else if (componentType === 'vocablist') { parts.push( ); - } else if (componentType === 'ConceptMap') { + } else if (componentType === 'conceptmap') { console.log('Creating ConceptMap component with props:', { yamlPath: fileName, currentPath: textbookPath, ...additionalProps }); parts.push( ); - } else if (componentType === 'YouTube') { + } else if (componentType === 'youtube') { parts.push( ); - } else if (componentType === 'ExamBrowser') { + } else if (componentType === 'exambrowser') { parts.push( ); - } else if (componentType === 'ProTip') { + } else if (componentType === 'protip') { parts.push( ); - } else if (componentType === 'AsAProfessor') { + } else if (componentType === 'asaprofessor') { parts.push(