← back to Rentv
fix(content-studio): stop the attribution scrub from deleting bare 'per'/'via' — they mangled common CRE prepositions in generated copy ('$928k per unit'→'$928k unit', '6% per annum'→'annum', 'via a JV'→'a JV'). Real 'per <outlet>' attribution already neutralized by the outlet-name strip above
95adcfbfbd0326ad59227e19ffb8e1b8e3f1a156 · 2026-08-06 10:53:08 -0700 · Steve
Files touched
Diff
commit 95adcfbfbd0326ad59227e19ffb8e1b8e3f1a156
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Aug 6 10:53:08 2026 -0700
fix(content-studio): stop the attribution scrub from deleting bare 'per'/'via' — they mangled common CRE prepositions in generated copy ('$928k per unit'→'$928k unit', '6% per annum'→'annum', 'via a JV'→'a JV'). Real 'per <outlet>' attribution already neutralized by the outlet-name strip above
---
server.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/server.js b/server.js
index 87712500..9e11508e 100644
--- a/server.js
+++ b/server.js
@@ -932,8 +932,11 @@ ${body || '(no body available — work from the title)'}`;
let t = String(s == null ? '' : s);
for (const nm of names) t = t.replace(new RegExp('\\b' + nm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '\\b', 'gi'), '');
t = t.replace(/https?:\/\/\S+/g, '');
- // strip attribution lead-ins the model may paraphrase (the outlet name itself is already gone above)
- t = t.replace(/\b(according to|as (?:first )?reported by|first reported by|as (?:the )?(?:outlet|publication|report|paper)s? (?:noted|reported)|per|via|reported by|reports? that|was covered by|covered by|sources? (?:told|said))\b[\s,:]*/gi, '');
+ // strip attribution lead-ins the model may paraphrase (the outlet name itself is already gone above).
+ // Do NOT add bare "per"/"via" here — they're common CRE prepositions ("$928k per unit", "$153 per sf",
+ // "6% per annum", "financed via a joint venture") and stripping them mangles the copy; a "per <outlet>"
+ // attribution is already neutralized because the outlet name was removed in the step above.
+ t = t.replace(/\b(according to|as (?:first )?reported by|first reported by|as (?:the )?(?:outlet|publication|report|paper)s? (?:noted|reported)|reported by|reports? that|was covered by|covered by|sources? (?:told|said))\b[\s,:]*/gi, '');
return t.replace(/\(\s*\)/g, '').replace(/\s{2,}/g, ' ').replace(/\s+([.,;:])/g, '$1').replace(/^[\s,;:.\-]+/, '').trim();
};
const started = Date.now();
← d7e04f05 feat(services): /services — Greater LA CRE services director
·
back to Rentv
·
Move Regions + Market Snapshot into the right hamburger (Sec f57a571a →