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

[Sheet.json][Default Sheet Settings] Default Sheet Settings cannot handle single and double quote character

1647266005

Edited 1647420781
Peter B.
Pro
Sheet Author
Hello Roll20 Help Center Ticket: 83867 I found a bug regarding the Sheet.json file and the Default Sheet Settings (useroptions) when trying to use values that contain single and double quotes. I have investigated the error and found that it happens in multiple areas. I have created a video showing the error and where it can be found. Here is the link to the video:   Roll20 Bug: Sheet.json cannot handle single and double quotes I will summarise my findings for each of the three test suites here: Single Quote The HTML for the button on the sheet is written like this: <input type="checkbox" name="attr_singlequoteX" value="quote'value"/> Sheet.json value Default Sheet Settings HTML value Reflected on save Reflected on sheet Comment quote'value quote ❌ ❌ The auto generated checkbox changes value, thus introducing the error quote\\'value quote\ ❌ ❌ - || - quote'value quote'value ❌ ✅ The escaped character gets correctly converted, and therefore correctly set on the sheet, but it not properly updated on the Default Sheet Settings quote'value quote'value ❌ ⚠️ The escaped character gets correctly converted once. The value is actually correct on the sheet, but not reflected on the checkbox. You have to click the value on the Attributes tab for it to update the sheet. quoteU+0027value quoteU+0027value ✅ ❌ Unicodes are not converted, and therefore does not appear on the sheet.  Double Quote with incorrect HTML syntax The HTML for the button on the sheet is written like this: <input type="checkbox" name="attr_doublequoteX" value='quote"value'/> /* <--- Notice the value attribute uses single quotes. Incorrect Syntax */ Sheet.json value Default Sheet Settings HTML value Reflected on save Reflected on sheet Comment quote\"value quote"value ✅ ❌ All of these versions do not work as the generated checkbox on the character sheet has the wrong value, due to the incorrect HTML syntax. quote"value quote"value ❌ ❌ quote"value quote"value ❌ ❌ quoteU+0022value quoteU+0022value ✅ ❌ Double Quote with encoded quote on sheet The HTML for the button on the sheet is written like this: <input type="checkbox" name="attr_doublequoteX" value="quote"value"/> /* <-- Encoded double quote*/ Sheet.json value Default Sheet Settings HTML value Reflected on save Reflected on sheet Comment quote\"value quote"value ✅ ✅ This combination actually works. Encoding the character in the HTML, and escaping the character in the sheet.json returns the correct result! quote"value quote"value ❌ ✅ The escaped character gets correctly converted, and therefore correctly set on the sheet, but it not properly updated on the Default Sheet Settings quote"value quote"value ❌ ⚠️ The escaped character gets correctly converted once. The value is actually correct on the sheet, but not reflected on the checkbox. You have to click the value on the Attributes tab for it to update the sheet. quoteU+0022value quoteU+0022value ✅ ❌ Unicodes are not converted, and therefore does not appear on the sheet.  The code used in this example HTML: <p>Single quotes test</p> <p>Checkboxes in HTML: <code>value="quote'value"</code></p> <input type="checkbox" name="attr_singlequote1" value="quote'value"/> <code>quote'value</code> <br> <input type="checkbox" name="attr_singlequote2" value="quote'value"/> <code>quote\\'value</code> <br> <input type="checkbox" name="attr_singlequote3" value="quote'value"/> <code>quote'value</code> <br> <input type="checkbox" name="attr_singlequote4" value="quote'value"/> <code>quote'value</code> <br> <input type="checkbox" name="attr_singlequote5" value="quote'value"/> <code>quoteU+0027value</code> <br> <br> <p>Double quote test</p> <p>Checkboxes in HTML: <code>value='quote"value'</code></p> <input type="checkbox" name="attr_doublequote1" value='quote"value'/> <code>quote\"value</code> <br> <input type="checkbox" name="attr_doublequote2" value='quote"value'/> <code>quote"value</code> <br> <input type="checkbox" name="attr_doublequote3" value='quote"value'/> <code>quote"value</code> <br> <input type="checkbox" name="attr_doublequote4" value='quote"value'/> <code>quoteU+0022value</code> <br> <br> <p>Double quote test</p> <p>Checkboxes in HTML: <code>value="quote"value"</code></p> <input type="checkbox" name="attr_doublequote5" value="quote"value"/> <code>quote\"value</code> <br> <input type="checkbox" name="attr_doublequote6" value="quote"value"/> <code>quote"value</code> <br> <input type="checkbox" name="attr_doublequote7" value="quote"value"/> <code>quote"value</code> <br> <input type="checkbox" name="attr_doublequote8" value="quote"value"/> <code>quoteU+0022value</code> <script type="text/worker"> const ATTRS = ['singlequote1', 'singlequote2', 'singlequote3', 'singlequote4', 'singlequote5', 'doublequote1', 'doublequote2', 'doublequote3', 'doublequote4', 'doublequote5', 'doublequote6', 'doublequote7', 'doublequote8']; on(ATTRS.map(s => 'change:'+s).join(' '), function(eventInfo) { console.log(eventInfo) }); </script> Sheet.json: { "useroptions": [ { "displayname": "### Single quotes in values test ###" }, { "displayname": "Single quote", "attribute": "singlequote1", "type": "checkbox", "value": "quote'value", "checked": false }, { "displayname": "Single quote esacped", "attribute": "singlequote2", "type": "checkbox", "value": "quote\\'value", "checked": false }, { "displayname": "Single quote encoded", "attribute": "singlequote3", "type": "checkbox", "value": "quote'value", "checked": false }, { "displayname": "Single quote double encoded", "attribute": "singlequote4", "type": "checkbox", "value": "quote'value", "checked": false }, { "displayname": "Single quote unicode", "attribute": "singlequote5", "type": "checkbox", "value": "quoteU+0027value", "checked": false }, { "displayname": " " }, { "displayname": "### Double quotes in values test ###" }, { "displayname": "Double quote esacped", "attribute": "doublequote1", "type": "checkbox", "value": "quote\"value", "checked": false }, { "displayname": "Double quote encoded", "attribute": "doublequote2", "type": "checkbox", "value": "quote"value", "checked": false }, { "displayname": "Double quote double encoded", "attribute": "doublequote3", "type": "checkbox", "value": "quote"value", "checked": false }, { "displayname": "Double quote double unicode", "attribute": "doublequote4", "type": "checkbox", "value": "quoteU+0022value", "checked": false }, { "displayname": " " }, { "displayname": "Double quote esacped", "attribute": "doublequote5", "type": "checkbox", "value": "quote\"value", "checked": false }, { "displayname": "Double quote encoded", "attribute": "doublequote6", "type": "checkbox", "value": "quote"value", "checked": false }, { "displayname": "Double quote double encoded", "attribute": "doublequote7", "type": "checkbox", "value": "quote"value", "checked": false }, { "displayname": "Double quote double unicode", "attribute": "doublequote8", "type": "checkbox", "value": "quoteU+0022value", "checked": false } ] } Summary Sheet.json cannot handle single quotes in a concise manner, and double quotes only work with a very particular setup. Please look into this and add a fix, for the single quote as a minimum. It should be working as it is valid json and valid HTML. Quick fixes and work arounds If you want to use single quotes in your Default Sheet Settings, make sure to use a special version of the single quote, such as: ’ If you want to use double quotes in your Default Sheet Settings, make sure to use a special version or make sure to encode the double quote for your HTML , and escape the quote for your Sheet.json file
1647302719
Andrew R.
Pro
Sheet Author
You should use the Help Center and Send a request to get Roll20 staff attention and a ticket to track your issue. It’s mostly community help here.  Excellent investigation!
1647325050
Peter B.
Pro
Sheet Author
Andrew R. said: You should use the Help Center and Send a request to get Roll20 staff attention and a ticket to track your issue. It’s mostly community help here.  Excellent investigation! I have already done that. I create My post here mainly to write out the problem in an proper formatted way. The text input on the Help Center does not allow for images, tables, or text formatting of any kind. Here on the forum I can present My findings i an readable manner. I then link My tricket to The forum post :)  I also write it here to let other sheet authors and player's know. A tricket sent to The Help Center cannot be share with other people :) Thank you for your compliment