Skip to content

Commit c37d50e

Browse files
dnwhtebmuenzenmeyer
authored andcommitted
Exclude patterns with variables from regex search
1 parent d10a13c commit c37d50e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/patternengine-node-nunjucks/lib/engine_nunjucks.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var engine_nunjucks = {
6666
expandPartials: false,
6767

6868
// regexes, stored here so they're only compiled once
69-
findPartialsRE: /{%\s*(?:extends|include|import|from)\s+(?:.*)\s*%}/g,
69+
findPartialsRE: /{%\s*(?:extends|include|import|from)\s+(?:'[^']+'|"[^"]+").*%}/g,
7070
findPartialKeyRE: /{%\s*(?:extends|include|import|from)\s+('[^']+'|"[^"]+")/,
7171
findListItemsRE: /({{#( )?)(list(I|i)tems.)(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)( )?}}/g, // still requires mustache style syntax because of how PL implements lists
7272

@@ -76,7 +76,6 @@ var engine_nunjucks = {
7676
// replace pattern names with their full path so Nunjucks can find them.
7777
pattern.extendedTemplate = this.replacePartials(pattern);
7878
var result = nunjucks.renderString(pattern.extendedTemplate, data);
79-
// var result = nunjucks.compile(pattern.extendedTemplate, env).render(data);
8079
return result;
8180
}
8281
catch (err) {

0 commit comments

Comments
 (0)