So if I refer to the:
Block Statements Priority
When used on the same element, the following priority list defines how block statements are evaluated:
data-sly-templatedata-sly-set, data-sly-test, data-sly-usedata-sly-calldata-sly-textdata-sly-element, data-sly-include, data-sly-resourcedata-sly-unwrapdata-sly-list, data-sly-repeatdata-sly-attribute
When two block statements have the same priority, their evaluation order is from left to right.
This would mean that when this is evaluated:
<thisdoesnotwork data-sly-unwrap="${true}" data-sly-element="${'div'}">TEST</thisdoesnotwork>
Then data-sly-element will convert this line into :
<div data-sly-unwrap="${true}" >TEST</div>
Then the unwarp should change it into
TEST
Desired outcome.
Obviously right now I had to do it the long way.
Also please note that the first line also has a wierd tab characted output when this happens, I am sure people would have noticed this as well, when they tested this.
{TAB}<span // missing closing brace
{space}{space}{space}{space}TEST
{space}{space}</span>