|
|
@@ -2764,7 +2764,26 @@ function handleEpisodeContent($originalContent) {
|
|
|
$segmentData['voice_actor'] = trim($voiceMatch[1]);
|
|
|
}
|
|
|
if (preg_match('/(?:台词内容|台词|对白|对话)[::]\s*([^\n]+)/u', $segmentContent, $dialogueMatch)) {
|
|
|
- $segmentData['dialogue'] = trim($dialogueMatch[1]) == '无' ? '' : trim($dialogueMatch[1]);
|
|
|
+ $dialogue = trim($dialogueMatch[1]) == '无' ? '' : trim($dialogueMatch[1]);
|
|
|
+
|
|
|
+ // 确保台词使用中文左右双引号
|
|
|
+ if (!empty($dialogue)) {
|
|
|
+ $dialogue = preg_replace('/^["”]/u', '“', $dialogue); // 替换句首英文双引号或中文右双引号
|
|
|
+ $dialogue = preg_replace('/["“]$/u', '”', $dialogue); // 替换句尾英文双引号或中文左双引号
|
|
|
+ // 句首或句尾没有中文双引号,则分别添加中文左右双引号
|
|
|
+ if (!preg_match('/^[“]/', $dialogue)) {
|
|
|
+ $dialogue = '“' . $dialogue;
|
|
|
+ }
|
|
|
+ if (!preg_match('/[”]$/', $dialogue)) {
|
|
|
+ $dialogue .= '”';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将修改后的台词替换回 $segmentContent
|
|
|
+ $originalDialogue = $dialogueMatch[1];
|
|
|
+ $segmentContent = str_replace($originalDialogue, $dialogue, $segmentContent);
|
|
|
+ }
|
|
|
+
|
|
|
+ $segmentData['dialogue'] = $dialogue;
|
|
|
}
|
|
|
if (preg_match('/(?:画面类型|镜头类型|类型)[::]\s*([^\n]+)/u', $segmentContent, $frameMatch)) {
|
|
|
$segmentData['frame_type'] = trim($frameMatch[1]);
|