Case sensitivity doesnt matter anymore

This commit is contained in:
MikeHughes-BIN
2026-01-15 10:45:32 +01:00
parent 1f96d90a2d
commit e40be401c8
@@ -52,8 +52,16 @@ const module_exports = {
// Extract name if value is an object
const displayName = typeof value === 'string' ? value : value.name;
// Replace speaker placeholder with display name
const regex = new RegExp(`\\b${placeholder}\\b`, 'g');
// Normalize placeholder for matching (remove case sensitivity)
const normalizedPlaceholder = placeholder.toLowerCase();
// Replace all variations: speakerA, SpeakerA, SPEAKERA, speaker_a, Speaker A, etc.
// Matches with optional spaces, underscores, and parentheses
const regex = new RegExp(
`\\b[Ss]peaker\\s*[_-]?\\s*${placeholder.charAt(placeholder.length - 1)}\\b|\\b${placeholder}\\b`,
'gi'
);
outputContent = outputContent.replace(regex, displayName);
});