fix build script

This commit is contained in:
Janik von Rotz committed 2021-06-25 18:11:48 +02:00
1 parent 2677aa1e2e
commit 4eff8b9b33
1 file changed
+6 -6
+6 -6
View File
@@ -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', ''))