Преглед изворни кода

fix: getPagePath would include a trailing (#1323) (#1324)

This excludes the trailing slash from the locale code.
alancnet пре 5 година
родитељ
комит
a457e82b16
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      server/helpers/page.js

+ 1 - 1
server/helpers/page.js

@@ -4,7 +4,7 @@ const crypto = require('crypto')
 const path = require('path')
 const path = require('path')
 
 
 const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/i
 const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/i
-const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?\/)?(.*)/i
+const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?)\/?(.*)/i
 
 
 const contentToExt = {
 const contentToExt = {
   markdown: 'md',
   markdown: 'md',