HTML content in viewerDynamicObjectMixin

   I've got twitter content streaming to the viewer, and I'm trying to embed images and hyperlinks. It seems like the viewerDynamicObjectMixin strips that content out of the description before displaying it. Is there a way to tell it to display img and a href tags?


To protect from XSS attacks by default, the InfoBoxViewModel runs the Google Caja sanitizer on HTML in the description. If you’re sure that your HTML is safe, you can replace the sanitation function:

viewer.infoBox.viewModel.sanitizer = function(input) {

// sanitize input HTML differently, or just return it as-is if you’re sure it’s safe


I’ll add that we may be overly restrictive by default. Mapbox uses a similar approach, but has loosened some of the restrictions. We may want to carefully consider doing the same.

Thanks! I'll try that when I'm back in the office tomorrow.

- Carl