defect
minor
#29367
Error in the TL Script Compiler when parsing HTML literals as the first expression in a block
The following TL script causes a compilation error:
setDescription = issue -> description -> {
$issue.set(`hype.issue:Issue#description`, {{{{$description}}}});
};
The error:
Syntax error: Encountered " "}" "} "" on line 2, column 69.
The attribute `hype.issue:Issue#description ` is an HTML attribute, which is why the variable "description" (which contains a string) is enclosed in four curly braces; this allows the string value to be written into the attribute.
If you execute any other statement before the line that sets the description, the compile error will no longer occur. Example:
setDescription = issue -> description -> {
info("Test");
$issue.set(`hype.issue:Issue#description`, {{{{$description}}}});
};
Another example where the error occurs:
if(1>2,
null,
{
$x.set(`hype.issue:Issue#description`, {{{{$description}}}})
}
);
However, it does not occur in the following case:
if(1>2,
null,
$x.set(`hype.issue:Issue#description`, {{{{$description}}}})
);