mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-05-08 03:01:16 +02:00
Make parseReferences() parse its own references
This commit is contained in:
parent
6292a73717
commit
b7bdd8d7e0
1 changed files with 34 additions and 31 deletions
|
@ -46,7 +46,9 @@ export function sortWords(render) {
|
|||
}
|
||||
}
|
||||
|
||||
export function parseReferences(detailsMarkdown, references) {
|
||||
export function parseReferences(detailsMarkdown) {
|
||||
const references = detailsMarkdown.match(/\{\{.+?\}\}/g);
|
||||
if (references && Array.isArray(references)) {
|
||||
new Set(references).forEach(reference => {
|
||||
let wordToFind = reference.replace(/\{\{|\}\}/g, '');
|
||||
let homonymn = 0;
|
||||
|
@ -83,6 +85,7 @@ export function parseReferences(detailsMarkdown, references) {
|
|||
detailsMarkdown = detailsMarkdown.replace(new RegExp(reference, 'g'), wordMarkdownLink);
|
||||
}
|
||||
});
|
||||
}
|
||||
return detailsMarkdown;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue