Open MatthewCallis opened 6 years ago
https://github.com/wkallhof/Hazel/blob/a4b4ebc3f513fe3d6107652e50ede955134cc961/app/controllers/documentController.js#L106-L113
I updated this code to (but also moved to using slugify):
missingLinks.forEach((link) => { const title = link.substr(1).slice(0, -3); const pairSlug = slugify(title, { lower: true }); document.markdown = document.markdown.replace(link, `[${title}](/${pairSlug})`); });
Also needed to make this RegEx a global search:
https://github.com/wkallhof/Hazel/blob/a4b4ebc3f513fe3d6107652e50ede955134cc961/app/utilities/documentParserUtility.js#L13
this._missingLinkRegex = /\[(.*)\]\(\)/g;
https://github.com/wkallhof/Hazel/blob/a4b4ebc3f513fe3d6107652e50ede955134cc961/app/controllers/documentController.js#L106-L113
I updated this code to (but also moved to using slugify):
Also needed to make this RegEx a global search:
https://github.com/wkallhof/Hazel/blob/a4b4ebc3f513fe3d6107652e50ede955134cc961/app/utilities/documentParserUtility.js#L13
this._missingLinkRegex = /\[(.*)\]\(\)/g;