@vuepress/shared
Advanced tools
Comparing version 2.0.0-rc.4 to 2.0.0-rc.5
@@ -82,4 +82,16 @@ // src/utils/resolveHeadIdentifier.ts | ||
var normalizeRoutePath = (path) => { | ||
const convertedMdPath = path.endsWith("README.md") ? path.substring(0, path.length - 9) : path.endsWith(".md") ? path.substring(0, path.length - 3) + ".html" : path; | ||
return convertedMdPath.endsWith("/index.html") ? convertedMdPath.substring(0, convertedMdPath.length - 10) : convertedMdPath.endsWith(".html") || convertedMdPath.endsWith("/") ? convertedMdPath : convertedMdPath + ".html"; | ||
if (!path || path.endsWith("/")) { | ||
return path; | ||
} | ||
let routePath = path.replace(/(^|\/)README.md$/i, "$1index.html"); | ||
if (routePath.endsWith(".md")) { | ||
routePath = routePath.substring(0, routePath.length - 3) + ".html"; | ||
} | ||
if (!routePath.endsWith(".html")) { | ||
routePath = routePath + ".html"; | ||
} | ||
if (routePath.endsWith("/index.html")) { | ||
return routePath.substring(0, routePath.length - 10); | ||
} | ||
return routePath; | ||
}; | ||
@@ -86,0 +98,0 @@ |
{ | ||
"name": "@vuepress/shared", | ||
"version": "2.0.0-rc.4", | ||
"version": "2.0.0-rc.5", | ||
"description": "Utils that shared between VuePress node and client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13969
393