File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
packages/engine-twig-php/lib Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ const engine_twig_php = {
28
28
engineFileExtension : '.twig' ,
29
29
expandPartials : false ,
30
30
findPartialsRE :
31
- / { % \s * (?: e x t e n d s | i n c l u d e | e m b e d ) \s + ( ' [ ^ ' ] + ' | " [ ^ " ] + " ) .* ?( w i t h | % } | \s * % } ) / g,
32
- findPartialKeyRE : / " ( (?: \\ .| [ ^ " \\ ] ) * ) " | ' ( (?: \\ .| [ ^ " \\ ] ) * ) ' / ,
31
+ / { [ % { ] \s * .* ?(?: e x t e n d s | i n c l u d e | e m b e d | f r o m | i m p o r t | u s e ) \( ? \s * [ ' " ] ( .+ ?) [ ' " ] [ \s \S ] * ?\) ? \s * [ % } ] } / g,
33
32
namespaces : [ ] ,
34
33
35
34
/**
@@ -180,9 +179,7 @@ const engine_twig_php = {
180
179
// return it.
181
180
findPartial : function ( partialString ) {
182
181
try {
183
- let partial = partialString . match ( this . findPartialKeyRE ) [ 0 ] ;
184
- partial = partial . replace ( / " / g, '' ) ;
185
- partial = partial . replace ( / ' / g, '' ) ;
182
+ const partial = partialString . replace ( this . findPartialsRE , '$1' ) ;
186
183
187
184
// Check if namespaces is not empty.
188
185
const selectedNamespace = this . namespaces . filter ( ( namespace ) => {
You can’t perform that action at this time.
0 commit comments