Explorar o código

regexp match end

sou %!s(int64=8) %!d(string=hai) anos
pai
achega
e9271fcb19
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lib/models/page.js

+ 2 - 1
lib/models/page.js

@@ -534,12 +534,13 @@ module.exports = function(crowi) {
     const Page = this;
     const templatePath = cutOffLastSlash(path);
     const pathList = generatePathsOnTree(templatePath, []);
-    const regexpList = pathList.map(path => new RegExp(`${path}/_{1,2}template`));
+    const regexpList = pathList.map(path => new RegExp(`${path}/_{1,2}template$`));
 
     return Page
       .find({path: {$in: regexpList}})
       .populate({path: 'revision', model: 'Revision'})
       .then(templates => {
+        templates.forEach(temp => {console.log(temp.path)})
         return fetchTemplate(templates, templatePath);
       });
   };