mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Case sensitivity doesnt matter anymore
This commit is contained in:
@@ -52,8 +52,16 @@ const module_exports = {
|
|||||||
// Extract name if value is an object
|
// Extract name if value is an object
|
||||||
const displayName = typeof value === 'string' ? value : value.name;
|
const displayName = typeof value === 'string' ? value : value.name;
|
||||||
|
|
||||||
// Replace speaker placeholder with display name
|
// Normalize placeholder for matching (remove case sensitivity)
|
||||||
const regex = new RegExp(`\\b${placeholder}\\b`, 'g');
|
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);
|
outputContent = outputContent.replace(regex, displayName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user