优化docx翻译1.1
This commit is contained in:
@@ -111,10 +111,12 @@ class DocxTranslator(AiTranslator):
|
|||||||
state['field_depth'] = max(0, state['field_depth'] - 1)
|
state['field_depth'] = max(0, state['field_depth'] - 1)
|
||||||
continue
|
continue
|
||||||
if isinstance(child, CT_R):
|
if isinstance(child, CT_R):
|
||||||
|
# 只跳过包含域指令的 Run
|
||||||
if child.find(qn('w:instrText')) is not None:
|
if child.find(qn('w:instrText')) is not None:
|
||||||
continue
|
continue
|
||||||
if state['field_depth'] > 0:
|
|
||||||
continue
|
# 删除了 'if state['field_depth'] > 0: continue' 这一行
|
||||||
|
|
||||||
run = Run(child, None)
|
run = Run(child, None)
|
||||||
if is_image_run(run) or is_formatting_only_run(run):
|
if is_image_run(run) or is_formatting_only_run(run):
|
||||||
flush_segment()
|
flush_segment()
|
||||||
|
|||||||
Reference in New Issue
Block a user