|
|
|
@ -119,10 +119,11 @@ def replace(template_path, filename_path, data_json):
|
|
|
|
repeat = True
|
|
|
|
repeat = True
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
for paragraph in cell.paragraphs:
|
|
|
|
for paragraph in cell.paragraphs:
|
|
|
|
|
|
|
|
paragraph.text = paragraph.text.replace(" ", "")
|
|
|
|
for run in paragraph.runs:
|
|
|
|
for run in paragraph.runs:
|
|
|
|
find = False
|
|
|
|
find = False
|
|
|
|
for datum in data_json:
|
|
|
|
for datum in data_json:
|
|
|
|
if datum["key"] in cell.text:
|
|
|
|
if datum["key"] in run.text:
|
|
|
|
find = True
|
|
|
|
find = True
|
|
|
|
if "text" == datum["type"]:
|
|
|
|
if "text" == datum["type"]:
|
|
|
|
run.text = run.text.replace(datum["key"], datum["value"])
|
|
|
|
run.text = run.text.replace(datum["key"], datum["value"])
|
|
|
|
|