Improve regex

This commit is contained in:
Augusto Gunsch 2022-01-09 11:00:59 -03:00
parent 191146da4b
commit 47f65f8a96
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ $(document).ready(() => {
if('form_of' in sense) { if('form_of' in sense) {
let word = sense.form_of[0].word; let word = sense.form_of[0].word;
html += sense.glosses[0].replace(new RegExp(`of ${word}$`), ''); html += sense.glosses[0].replace(new RegExp(`of ${word}.?$`), '');
html += ` of <a href="#${word}" class="link-primary">${word}</a>`; html += ` of <a href="#${word}" class="link-primary">${word}</a>`;
} else { } else {
let link = ' of <a href="#$1" class="link-primary">$1</a>'; let link = ' of <a href="#$1" class="link-primary">$1</a>';