-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple namespaces fix #580
Conversation
Hi @stefanullinger , thanks for your contribution. Could you add a unit test that fails before your change and passes afterwards? |
Hi @dave-irvine, The problem I had were as follows: Twig.twig({ when my twig uses {% include "@molecules/testfile.twig"%}, it won't find the file because it looks at /patterns/atoms/testfile.twig, instead of patterns/molecules/testfile.twig |
Seems like this is more of a performance update? It says if the namespace is not found in the given file, skip it. In theory, tests should pass with or without this change. |
src/twig.path.js
Outdated
@@ -27,6 +27,9 @@ module.exports = function (Twig) { | |||
|
|||
if (hasNamespaces){ | |||
for (k in namespaces) { | |||
if (file.indexOf(k) === -1) { | |||
continue | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 3 spaces instead of 2.
Hi @RobLoach, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good change that doesn't affect tests negatively 👍
Fix to allow multiple namespaces