aafre/resume-builder

refactor: extract shared LaTeX utility functions into a common module

Open

#248 创建于 2026年1月31日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)TypeScript (15 fork)auto 404
Pythongood first issuerefactor

仓库指标

Star
 (6 star)
PR 合并指标
 (PR 指标待抓取)

描述

Summary

convert_markdown_formatting_to_latex and _escape_remaining_latex_chars are duplicated in two files:

  • app.py (lines 591, 640)
  • resume_generator_latex.py (lines 39, 86)

These should be extracted into a shared utility module to prevent them from drifting out of sync.

What to change

  1. Create a new file latex_utils.py in the project root.
  2. Move convert_markdown_formatting_to_latex and _escape_remaining_latex_chars into it.
  3. Update app.py to import from latex_utils.py instead of defining them inline.
  4. Update resume_generator_latex.py to import from latex_utils.py instead of defining them inline.
  5. Verify no other files duplicate these functions.

Acceptance criteria

  • Both functions live in a single latex_utils.py module
  • app.py and resume_generator_latex.py import from latex_utils.py
  • No duplicate definitions remain
  • Existing tests pass (cd resume-builder-ui && npm test for frontend; backend tests if applicable)
  • PDF generation still works correctly via both entry points (app.py and resume_generator_latex.py)

Context

Flagged in PR #244 review. The functions were added to resume_generator_latex.py as part of the LaTeX escaping fix, mirroring the existing implementation in app.py.

贡献者指南