aiaiteam commited on
Commit
22e0fb1
·
1 Parent(s): e031811

Fix HWPX: hp:PC -> hp:Run + hp:RPr (correct HWPML structure)

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -364,10 +364,11 @@ def download_hwpx(req: HwpxRequest):
364
 
365
  def _para(pid, line):
366
  txt = xe(line)
367
- t = f'<hp:T CharPrIDRef="0">{txt}</hp:T>' if txt else ""
 
368
  return (f' <hp:P Id="{pid}">'
369
  f'<hp:PPr ParaPrIDRef="0"/>'
370
- f'<hp:PC>{t}</hp:PC>'
371
  f'</hp:P>')
372
 
373
  body = "\n".join(_para(i, l) for i, l in enumerate(lines))
 
364
 
365
  def _para(pid, line):
366
  txt = xe(line)
367
+ run = (f'<hp:Run><hp:RPr CharPrIDRef="0"/><hp:T>{txt}</hp:T></hp:Run>'
368
+ if txt else "")
369
  return (f' <hp:P Id="{pid}">'
370
  f'<hp:PPr ParaPrIDRef="0"/>'
371
+ f'{run}'
372
  f'</hp:P>')
373
 
374
  body = "\n".join(_para(i, l) for i, l in enumerate(lines))