Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ingestion/parsers/resume_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _parse_markdown(self, content: str) -> ParseResult:
def _strip_markdown(self, content: str) -> str:
"""Remove markdown syntax from content."""
# Remove markdown headers
text = re.sub(r"^#+\s+", "", content, flags=re.MULTILINE)
text = re.sub(r"^[ \t]*#+\s+", "", content, flags=re.MULTILINE)

# Remove markdown links [text](url)
text = re.sub(r"\[([^\]]+)\]\(([^\)]+)\)", r"\1", text)
Expand Down Expand Up @@ -131,10 +131,10 @@ def _detect_sections(self, text: str) -> list[str]:
for section in SECTION_HEADERS:
# Look for section header patterns
patterns = [
rf"^{re.escape(section)}\s*$",
rf"^{re.escape(section)}\s*[:|-]",
rf"\n{re.escape(section)}\s*$",
rf"\n{re.escape(section)}\s*[:|-]",
rf"^[ \t]*{re.escape(section)}\s*$",
rf"^[ \t]*{re.escape(section)}\s*[:|-]",
rf"\n[ \t]*{re.escape(section)}\s*$",
rf"\n[ \t]*{re.escape(section)}\s*[:|-]",
]

for pattern in patterns:
Expand Down
15 changes: 0 additions & 15 deletions tests/unit/test_resume_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def parser(self):
"""Create a ResumeParser instance."""
return ResumeParser()

@pytest.mark.xfail(
strict=True, reason="issue #54: resume section detection fails on leading whitespace"
)
def test_parse_single_column_resume_text(self, parser, sample_resume_text):
"""Test parsing a standard single-column resume text."""
result = parser.parse(sample_resume_text)
Expand All @@ -36,9 +33,6 @@ def test_parse_single_column_resume_text(self, parser, sample_resume_text):
"skills" in s for s in detected_lower
)

@pytest.mark.xfail(
strict=True, reason="issue #54: resume section detection fails on leading whitespace"
)
def test_parse_resume_no_work_experience(self, parser):
"""Test parsing a resume with no work experience section - handles gracefully."""
resume_no_work = """
Expand Down Expand Up @@ -87,9 +81,6 @@ def test_parse_multipage_pdf(self, parser):
assert "Page 2 Content" in result.text
assert "Page 3 Content" in result.text

@pytest.mark.xfail(
strict=True, reason="issue #54: resume section detection fails on leading whitespace"
)
def test_parse_markdown_resume(self, parser):
"""Test parsing a Markdown resume."""
markdown_resume = """
Expand Down Expand Up @@ -132,9 +123,6 @@ def test_parse_invalid_list_content(self, parser):
exc_info.value
)

@pytest.mark.xfail(
strict=True, reason="issue #54: resume section detection fails on leading whitespace"
)
def test_detect_sections(self, parser):
"""Test section detection in resume text."""
text = """
Expand All @@ -155,9 +143,6 @@ def test_detect_sections(self, parser):
assert any("education" in s for s in sections_lower)
assert any("skills" in s for s in sections_lower)

@pytest.mark.xfail(
strict=True, reason="issue #54: resume section detection fails on leading whitespace"
)
def test_strip_markdown_syntax(self, parser):
"""Test markdown syntax stripping."""
markdown_text = """
Expand Down
Loading