@vuepress/shared
Advanced tools
Comparing version 2.0.0-rc.5 to 2.0.0-rc.6
@@ -82,16 +82,16 @@ // src/utils/resolveHeadIdentifier.ts | ||
var normalizeRoutePath = (path) => { | ||
if (!path || path.endsWith("/")) { | ||
const [pathname, ...rest] = path.split(/(\?|#)/); | ||
if (!pathname || pathname.endsWith("/")) | ||
return path; | ||
} | ||
let routePath = path.replace(/(^|\/)README.md$/i, "$1index.html"); | ||
const queryAndHash = rest.length > 0 ? rest.join("") : ""; | ||
let routePath = pathname.replace(/(^|\/)README.md$/i, "$1index.html"); | ||
if (routePath.endsWith(".md")) { | ||
routePath = routePath.substring(0, routePath.length - 3) + ".html"; | ||
} | ||
if (!routePath.endsWith(".html")) { | ||
} else if (!routePath.endsWith(".html")) { | ||
routePath = routePath + ".html"; | ||
} | ||
if (routePath.endsWith("/index.html")) { | ||
return routePath.substring(0, routePath.length - 10); | ||
return routePath.substring(0, routePath.length - 10) + queryAndHash; | ||
} | ||
return routePath; | ||
return routePath + queryAndHash; | ||
}; | ||
@@ -98,0 +98,0 @@ |
{ | ||
"name": "@vuepress/shared", | ||
"version": "2.0.0-rc.5", | ||
"version": "2.0.0-rc.6", | ||
"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
14121