From 4eff8b9b33ccdaa2ae9151aca2dc5ee76559704e Mon Sep 17 00:00:00 2001 From: Janik von Rotz Date: Fri, 25 Jun 2021 18:11:48 +0200 Subject: [PATCH] fix build script --- build.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.js b/build.js index 91c1fa6f..9fb95961 100644 --- a/build.js +++ b/build.js @@ -72,12 +72,6 @@ function convert(content, file) { let title = match.match(/\[\[([^\]|#]*)/)[1] let anchor = null - // set title and href - if (match.indexOf('|') > 0) { - href = match.match(/\[\[([^\||#]*)/)[1] - title = match.match(/\|(.*)\]\]/)[1] - } - // set anchor if (match.indexOf('#') > 0) { anchor = match.match(/#([^\||\]]*)/)[1] @@ -89,6 +83,12 @@ function convert(content, file) { anchor = sanitizeName(anchor) } + // set title and href + if (match.indexOf('|') > 0) { + href = match.match(/\[\[([^\||#]*)/)[1] + title = match.match(/\|(.*)\]\]/)[1] + } + // sanitize href href = sanitizeName(href ? href : file.replace('\.md', ''))