Skip to content

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

Merged
stickerdaniel merged 3 commits into
stickerdaniel:mainfrom
lfazliev:fix/non-latin-reference-labels
Jul 25, 2026
Merged

fix(references): keep non-Latin reference labels#566
stickerdaniel merged 3 commits into
stickerdaniel:mainfrom
lfazliev:fix/non-latin-reference-labels

Conversation

@lfazliev

@lfazliev lfazliev commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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 updates reference label cleaning so non-Latin names are preserved. The main changes are:

  • Adds a Unicode-aware label content check.
  • Excludes invisible Hangul filler-only labels from valid reference text.
  • Adds tests for Cyrillic names, punctuation-only labels, and invisible filler fallback.

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 Updates clean_label to keep Unicode letters and digits while rejecting filler-only invisible labels.
tests/test_link_metadata.py Adds tests for non-Latin reference labels and invalid label fallback behavior.

Reviews (2): Last reviewed commit: "fix(references): reject invisible-only l..." | Re-trigger Greptile

The widened Unicode guard also admits the four Hangul fillers, which
carry the word property but render as nothing. A label made only of
them passed as valid and shadowed the aria-label fallback with
invisible text, which the previous ASCII guard had rejected.

Exclude them from the content class and name it, so the intent is
readable at the definition rather than inline.
@stickerdaniel

Copy link
Copy Markdown
Owner

Hey, thanks for this! Rebased onto main and pushed one commit on top: [^\W_] also lets the four Hangul fillers through, so an invisible-only label passed and shadowed the aria_label fallback. Excluded them.

@stickerdaniel
stickerdaniel merged commit b3b4ff8 into stickerdaniel:main Jul 25, 2026
6 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.

3 participants