From 57338dc0ce5c73a244a21ae30105f5a4fc79ff8e Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Sun, 26 Dec 2021 16:38:49 -0300 Subject: [PATCH] Add fallback regex --- static/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/index.js b/static/index.js index 468172d..00757ff 100644 --- a/static/index.js +++ b/static/index.js @@ -159,7 +159,8 @@ $(document).ready(() => { html += sense.glosses[0].replace(new RegExp(`of ${word}$`), ''); html += ` of ${word}`; } else { - html += sense.glosses[0]; + let link = ' of $1'; + html += sense.glosses[0].replace(/of\s+([\u00BF-\u1FFF\u2C00-\uD7FF\w]+)\s*$/, link); } html += '';