This repository was archived by the owner on May 18, 2024. It is now read-only.
Fix running JavaScript (-) to specification. #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I saw the undocumented custom filter hacks referred to by #9 but those
:ifand:loopconstructs are one of the gripes I have with jade, these are not required in a templating engine, IMO. We have sufficient ability to handle conditions and loops in the underlying language so it is unnecessary for the template engine to duplicate the effort.Whether to keep the out of spec features or not is not what this patch is aiming for, instead it is an attempt to make the JavaScript lines run as
-working as is expected.What has been added:
{{See spec for example.
Although this is already very useful and serves the majority of use cases there are some things that still need attention. We currently only consider the immediate block of the parent but in certain conditions we will have to take the first outdent into consideration. This means that the following will not work yet.
elseandelse ifstatements will not work as we prepare the _$output variable for subsequent lines after the if statement was already closed.Because we are not yet considering the first outdented line something like
setTimeoutis not possible yet.ex.
But even with these remaining limitations I consider this patch a move in the right direction as the rawjs implementation is not of any use currently.