How about this?
@renderTestA(renderTestB("test string 1"), renderTestB("test string 2")) @helper renderTestA(string input1, string input2) { <div> @input1 @input2 </div> } @helper renderTestB(string input) { <p class="test">@input</p> }
Instead, you should use editor / display templates or custom HTML helpers, as @helper functionality was used before these functions became normal.
Regarding why you cannot invest them. It introduces a number of problems that are easy to avoid using the syntax above. For example ... if you have a looping cycle of nested helpers, this can easily cause a stack overflow.
source share