Skip to content

Commit ef3d3ad

Browse files
authored
repo sync
2 parents 02ca054 + 06364de commit ef3d3ad

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

lib/path-utils.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ function getPathWithLanguage (href, languageCode) {
7171
// remove the language from the given HREF
7272
// /articles/foo -> /en/articles/foo
7373
function getPathWithoutLanguage (href) {
74-
const newHref = href.match(patterns.hasLanguageCode)
75-
? '/' + href.split('/').slice(2).join('/')
76-
: href
77-
78-
return slash(newHref)
74+
return slash(href.replace(patterns.hasLanguageCode, '/'))
7975
}
8076

8177
function getPathWithoutVersion (href) {

0 commit comments

Comments
 (0)