From 5596eec702cea33f07ade114504718d3e23d6fa5 Mon Sep 17 00:00:00 2001 From: Mara Date: Fri, 26 Jan 2024 21:19:48 +0100 Subject: [PATCH] better function name --- src/conversion/links.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conversion/links.ts b/src/conversion/links.ts index 12b0aa2f..094048ee 100644 --- a/src/conversion/links.ts +++ b/src/conversion/links.ts @@ -205,12 +205,12 @@ function createMarkdownLinks(fileName: string, isEmbed: string, altLink: string, const anchorMatch = fileName.match(/(#.*)/); let anchor = anchorMatch ? anchorMatch[0] : null; const encodedURI = encodeURI(markdownName); - anchor = slugifyWithSettings(anchor, settings); + anchor = slugifyAnchor(anchor, settings); return `${isEmbed}[${altLink}](${encodedURI}${anchor})`; } -function slugifyWithSettings(anchor: string | null, settings: GitHubPublisherSettings) { +function slugifyAnchor(anchor: string | null, settings: GitHubPublisherSettings) { if (anchor && settings.conversion.links.slugify !== "disable") { switch (settings.conversion.links.slugify) { case "lower": @@ -300,7 +300,7 @@ export async function convertToInternalGithub( let newLink = link.replace(regToReplace, pathInGithubWithAnchor); //strict replacement of link if (link.match(/\[.*\]\(.*\)/)) { if (linkedFile.linked.extension === "md" && !linkedFile.linked.name.includes("excalidraw")) { - anchor = slugifyWithSettings(anchor, settings); + anchor = slugifyAnchor(anchor, settings); pathInGithub = `${pathInGithub.replaceAll(" ", "%20")}.md#${anchor}`; //probably useless // pathInGithub = pathInGithub.replace(/(\.md)?(#.*)/, ".md$2");