fix: quitar las expresiones regulares con propiedades Unicode
Mismo cambio que en la version de movil. En escritorio no rompe —Node lleva ICU completo— pero el codigo es compartido y conviene que no diverja.
This commit is contained in:
parent
f79573b317
commit
b01784d213
2 changed files with 2 additions and 2 deletions
|
|
@ -6155,7 +6155,7 @@ router
|
|||
const raw = String(ctx.request.body?.q || ctx.request.body?.prompt || '').trim();
|
||||
if (!raw) { ctx.redirect('/'); return; }
|
||||
const ssbRefLib = require('../server/node_modules/ssb-ref');
|
||||
const hashtagMatch = raw.match(/^#([\p{L}\p{N}_-]+)/u);
|
||||
const hashtagMatch = raw.match(/^#([0-9A-Za-z_À--]+)/); // sin \p{}: nodejs-mobile no lleva ICU completo
|
||||
if (hashtagMatch) {
|
||||
ctx.redirect('/search?query=' + encodeURIComponent('#' + hashtagMatch[1]));
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const TITLE_STOPWORDS = new Set([
|
|||
|
||||
const titleTerms = (c) => String(c.title || c.name || c.question || c.concept || '')
|
||||
.toLowerCase()
|
||||
.split(/[^\p{L}\p{N}]+/u)
|
||||
.split(/[^0-9A-Za-zÀ-]+/) // sin \p{}: nodejs-mobile no lleva ICU completo
|
||||
.filter(w => w.length >= 3 && !TITLE_STOPWORDS.has(w) && !/^\d+$/.test(w));
|
||||
|
||||
const termsOf = (kind, c) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue