Skip to content

fix: preserve bullet line breaks and date hyphens - #119

Merged
LoneRifle merged 2 commits into
opengovsg:masterfrom
Neautrino:fix/bullet-points
Aug 25, 2026
Merged

fix: preserve bullet line breaks and date hyphens#119
LoneRifle merged 2 commits into
opengovsg:masterfrom
Neautrino:fix/bullet-points

Conversation

@Neautrino

Copy link
Copy Markdown

Problem

Bullet points in PDF resumes are concatenated into single lines, and date hyphens (e.g., 06/2022 - Present) are stripped to 06/2022 Present.

Solution

Bug Fixes:

  • Added replace(/ • /g, '\n• ') to ensure each bullet point starts on its own line
  • Replaced aggressive split('- ').join('') with targeted replace(/(\w)- \n(\w)/g, '$1$2') that only removes hyphens at actual line breaks (word continuation), preserving content hyphens

Before & After

BEFORE:

• (^) Built and scaled... • (^) Ensured financial correctness... • (^) Integrated Razorpay... (all on one line)
06/2022 Present ,

AFTER:

• (^) Built and scaled...
• (^) Ensured financial correctness...
• (^) Integrated Razorpay...
06/2022 - Present ,

Tests

  • Run node -e "const pdf2md = require('./lib/pdf2md'); ..." with a PDF containing bullets and date ranges
  • Verify bullet lines are separated (count should match PDF bullet count)
  • Verify date ranges preserve hyphens

Deploy Notes

No new dependencies, scripts, or environment variables.

- Add bullet line break detection (• character)
- Replace aggressive hyphen stripping with targeted line-break only
- Fixes all bullet points being concatenated into single lines
- Items with X gap > 15px get triple space separator
- Improves column separation in 2-column layouts (skills, contact info)
- Preserves single space for normal word spacing

@LoneRifle LoneRifle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@LoneRifle
LoneRifle merged commit 236e0ea into opengovsg:master Aug 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants