Skip to content

fix(references): keep non-Latin reference labels#566

Open
lfazliev wants to merge 1 commit into
stickerdaniel:mainfrom
lfazliev:fix/non-latin-reference-labels
Open

fix(references): keep non-Latin reference labels#566
lfazliev wants to merge 1 commit into
stickerdaniel:mainfrom
lfazliev:fix/non-latin-reference-labels

Conversation

@lfazliev

@lfazliev lfazliev commented Jul 6, 2026

Copy link
Copy Markdown

What

clean_label rejected any reference label without an ASCII alphanumeric
character ([A-Za-z0-9]), so Cyrillic and other non-Latin profile names —
common in RU/BY and other locales' people-search results — were silently
dropped. Relax the guard to the Unicode word-character check [^\W_]: a label
is kept when it has at least one letter or digit in any script, while pure
punctuation/symbol labels are still rejected.

Tests

  • test_keeps_cyrillic_only_names — a Cyrillic-only name survives cleaning.
  • test_rejects_punctuation_only_labels_across_scripts — punctuation-only
    labels are still dropped.

Synthetic prompt

In link_metadata.clean_label, the [A-Za-z0-9] guard drops valid non-Latin
(e.g. Cyrillic) profile names. Relax it to a Unicode word-character check so
any-script letters/digits pass while punctuation-only labels stay rejected.
Add regression tests.

clean_label rejected any label without [A-Za-z0-9], so people whose
names render entirely in Cyrillic (or another non-Latin script) were
silently dropped from search-result references. Require a Unicode
letter or digit instead; pure punctuation is still rejected.

(cherry picked from commit f2d7d073cb5342d33eb315f2f5acda2b24d655e3)
@lfazliev lfazliev force-pushed the fix/non-latin-reference-labels branch from 31af3bd to 2d6fa7f Compare July 6, 2026 23:22
@lfazliev lfazliev marked this pull request as ready for review July 6, 2026 23:34
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR keeps non-Latin reference labels during link metadata cleanup. The main changes are:

  • Uses a Unicode letter-or-digit check in clean_label.
  • Preserves Cyrillic-only profile names in scraped references.
  • Adds tests for Cyrillic labels and punctuation-only fallback behavior.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
linkedin_mcp_server/scraping/link_metadata.py Changes the final label-content guard from ASCII-only matching to a Unicode letter-or-digit check while keeping punctuation-only labels rejected.
tests/test_link_metadata.py Adds tests for preserving Cyrillic-only names and falling back from punctuation-only visible text to aria_label.

Reviews (1): Last reviewed commit: "fix(references): keep non-Latin referenc..." | Re-trigger Greptile

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