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.
It often happens that only one field from a subsecion is to be rendered. For this, one currently has to write
{{#section}}{{field}}{{/section}}
, which is quite verbose. This PR adds the posibility to write this as{{section field}}
, or to nest arbitrary many such subsecions, like{{section subsecion field}}
.Furthermore, it allows opening arbitrarily many sections as
{{#section subsecion subsubsection}}
, or closing them as{{/subsubsection subsecion section}}
(in the order they are closed).Apart from readability, this should also improve rendering performance a bit, since unnecessary closing blocks with no HTML data are not added (
{{section field}}
doesn't require a closing block, the span of the section is automatically calculated).On my machine, surprisingly, the parsing benchmark also turns out a bit beter than before, probably because trimming of whitespace and hashing of fields where it is not necessary is eliminated.