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

Handout HTML, anyone know what restrictions are?

1462780202
Lucian
Pro
API Scripter
Hi, I'm using the API to generate some handouts (they're journal entries that can be updated by commands from chat). I'm able to make my chat window output look pretty now: But I'm struggling a bit more with the handouts, which appear to support a different subset of HTML to the chat window. In particular, it seems like background images don't work. Before I beat my head against the trial-and-error wall, does anyone have any pointers on what works and what doesn't? Thanks! Lucian
1462794150

Edited 1462794217
Lucian
Pro
API Scripter
Ok, so I've played around with this some more and I think I understand the problem. The Redactor Wyswig editor that we all know and love for its ... interesting... behaviour makes liberal use of !important in its stylesheet (not sure if this is baked in or Roll20 modification). This would be easily fixed with the application of !important on inline styles, except for the fact that the Roll20 code strips that out as part of an HTML sanitisation process. See&nbsp; <a href="https://app.roll20.net/forum/post/3349839/sendchat" rel="nofollow">https://app.roll20.net/forum/post/3349839/sendchat</a>... for more details. The sanitising code isn't enormously robust (I can get it to break and leave invalid CSS relatively easily) but as yet I haven't found a way to break it in a useful fashion. It's hundreds of lines of minified JS that makes liberal use of Regex and eval() so my patience with it is now exhausted - I've created a Stylish rule for myself for the time being and I have fingers crossed that perhaps Roll20 will relent and tone down their CSS stripping a bit....
1463014500
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
how'd you get the pretty scroll chat output. (I'm assuming that's chat output)? Because that's awesome.
1463033390
Lithl
Pro
Sheet Author
API Scripter
Scott C. said: how'd you get the pretty scroll chat output. (I'm assuming that's chat output)? Because that's awesome. An API script or a character sheet roll template could both accomplish it. If the text were part of an image (instead of being actual text with an image background), you could also do it in normal chat with [alt-text](<a href="http://example.com/my/image.jpg" rel="nofollow">http://example.com/my/image.jpg</a>)