HoneyBadger said: Roll queries don't work with the API at all. The way he's wanting to use them, they should. I do it all the time (see Group Initiative's prompts for number of dice, sides of die, etc..). The key is that you have to replace the characters that trigger the expansion of the Roll Query (or any macro, really) enough times that they aren't expanded until the button is pressed. In my more recent scripts I use this function: var esRE = function (s) {
var escapeForRegexp = /(\\|\/|\[|\]|\(|\)|\{|\}|\?|\+|\*|\||\.|\^|\$)/g;
return s.replace(escapeForRegexp,"\\$1");
},
HE = (function(){
var entities={
'<' : '&'+'lt'+';',
'>' : '&'+'gt'+';',
"'" : '&'+'#39'+';',
'@' : '&'+'#64'+';',
'{' : '&'+'#123'+';',
'|' : '&'+'#124'+';',
'}' : '&'+'#125'+';',
'[' : '&'+'#91'+';',
']' : '&'+'#93'+';',
'"' : '&'+'quot'+';'
},
re=new RegExp('('+_.map(_.keys(entities),esRE).join('|')+')','g');
return function(s){
return s.replace(re, function(c){ return entities[c] || c; });
};
}()); It will perform the escapes necessary to allow the expression to be passed on. The more evaluations the expression needs to pass through, the more escaping you need to do. (Passing things into tipsy titles takes two calls: HE(HE(<something)) ). You might try injecting some calls to that in your code and see if it fixes things? '{{Bar:=<a href="'+ HE( !aura bar ?{BarNumber?|1} ) +'">'+state.auraBar+'</a>}}' '{{Bar:=<a href="'+ HE(HE( !aura bar ?{BarNumber?|1} )) +'">'+state.auraBar+'</a>}}' '{{Bar:=<a href="'+ HE(HE(HE( !aura bar ?{BarNumber?|1} ))) +'">'+state.auraBar+'</a>}}'