quoteComment function
Escape comment end delimiters in a string, optionally wrapping in unescaped comment delimiters.
Implementation
String quoteComment(String text, [bool includeDelimiters = false]) {
// escape
var result = text.replaceAll("#>", "\\#>");
// delimit
if (includeDelimiters) {
result = "<# $result #>";
}
// return
return result;
}