Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Roll Helper Functions Choke on Double Quotes?

1487708973

Edited 1487709339
Isurandil
Pro
Sheet Author
<div class="sheet-maindiv"> <button type="roll" value="&{template:bug} {{name=Bug}} {{target=[[?{Choose|Fire,0|Water,1}]]}}">BUG</button> <button type="roll" value="&{template:bug-free} {{name=Bug}} {{target=[[?{Choose|Fire,0|Water,1}]]}}">OK</button> </div> <rolltemplate class="sheet-rolltemplate-bug"> <div style="color: #7F0000"> <span     {{#rollTotal() target 0}}title="Fire"{{/rollTotal() target 0}}     {{#rollTotal() target 1}}title="Water"{{/rollTotal() target 1}} >Element</span>. Hovering the number gives a nicely sized hint box in Firefox. Unfortunately, the roll query will always evaluate to fire/0. </div> </rolltemplate> <rolltemplate class="sheet-rolltemplate-bug-free"> <div style="color: #007F00"> <span title="     {{#rollTotal() target 0}}Fire{{/rollTotal() target 0}}     {{#rollTotal() target 1}}Water{{/rollTotal() target 1}} ">Element</span>. Hovering the number gives a big hint box in Firefox. At least, the roll query evaluates correctly. </div> </rolltemplate> When using roll templates, I came across the following problem. I used roll helper functions within an HTML element (<span> in the above example) and noticed that when giving the attribute "title" as above I will get a big hint box. Trying to mask the whitespace (inspired by LaTeX) with <!-- [... whitespace ...] --> did not work, but putting the whole title attribute inside worked. Kinda. The roll query always evaluates to the first option. I have not found a definite answer on what exactly causes this problem, tried to replace = and " with their HTML entities to no avail. Not sure whether this really is a bug or just me doing it wrong.
nice
1490225893
Gid
Roll20 Team
The issue here is likely because you're attempting to run these elements within the span tag itself. We recommend trying this instead: {{#rollTotal() target 0}} <span title="Fire">Element</span> {{/rollTotal() target 0}} {{#rollTotal() target 1}} <span title="Water">Element</span> {{/rollTotal() target 1}} In this fashion, only the desired Element span will be shown depending on whether a 0 or 1 is rolled.