Skip to content

Commit

Permalink
fix($core): decode regularPath when generate router config (fix #1946) (
Browse files Browse the repository at this point in the history
  • Loading branch information
fangbinwei authored Aug 23, 2020
1 parent 94a7de4 commit dd26c7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@vuepress/core/lib/node/internal-plugins/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ function routesCode (pages) {
}`
}

if (regularPath !== pagePath) {
const decodedRegularPath = decodeURIComponent(regularPath)

if (decodedRegularPath !== pagePath) {
code += `,
{
path: ${JSON.stringify(regularPath)},
path: ${JSON.stringify(decodedRegularPath)},
redirect: ${JSON.stringify(pagePath)}
}`
}
Expand Down

0 comments on commit dd26c7c

Please sign in to comment.