← back to Rentv
pr/linkedin: anchor stripLinkedIn to the LAST separator-before-LinkedIn (greedy ^(.*)) — self-gate caught that the first-match .* form (in the old code AND my first pass) truncated real 'LinkedIn Marketing Manager'-type titles to just the name. Now the trailing SERP tag is stripped while LinkedIn-as-content is preserved; verified 6 cases
2221ee51553db85fe5e5d7ab3eab9a7024e77645 · 2026-08-05 20:57:39 -0700 · Steve
Files touched
M src/pr/adapters/linkedin.js
Diff
commit 2221ee51553db85fe5e5d7ab3eab9a7024e77645
Author: Steve <steve@designerwallcoverings.com>
Date: Wed Aug 5 20:57:39 2026 -0700
pr/linkedin: anchor stripLinkedIn to the LAST separator-before-LinkedIn (greedy ^(.*)) — self-gate caught that the first-match .* form (in the old code AND my first pass) truncated real 'LinkedIn Marketing Manager'-type titles to just the name. Now the trailing SERP tag is stripped while LinkedIn-as-content is preserved; verified 6 cases
---
src/pr/adapters/linkedin.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/pr/adapters/linkedin.js b/src/pr/adapters/linkedin.js
index 221cd144..16d3d964 100644
--- a/src/pr/adapters/linkedin.js
+++ b/src/pr/adapters/linkedin.js
@@ -10,9 +10,11 @@ const { report, register } = require('./index');
const search = require('./search');
const { normalizeLinkedInUrl } = require('../lib/normalize');
-// Strip the trailing " | LinkedIn" / " · LinkedIn" / " – LinkedIn" (any separator) SERP suffix from
-// a result title. One helper so the two call sites can't drift on which separators they cover.
-const stripLinkedIn = (t) => String(t || '').replace(/\s*[|·–—-]\s*LinkedIn\b.*$/i, '').trim();
+// Strip the trailing " | LinkedIn" (any separator: pipe/middot/en/em-dash/hyphen) SERP suffix from
+// a result title. Greedy `^(.*)` anchors to the LAST separator-before-LinkedIn, so a title that
+// legitimately contains "LinkedIn" ("- LinkedIn Marketing Manager -") isn't truncated to the name.
+// One helper so the two call sites can't drift on which separators they cover.
+const stripLinkedIn = (t) => String(t || '').replace(/^(.*)[|·–—-]\s*LinkedIn\b.*$/i, '$1').trim();
const adapter = register({
name: 'linkedin',
← dc165ff3 pr/linkedin: unify the ' | LinkedIn' SERP-suffix strip into
·
back to Rentv
·
pr/linkedin: Cody gate — extract shared LI_SEP so stripLinke f1f7cb33 →