Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlebars Template stripped out of classes #147

Closed
SirPhoros opened this issue Nov 27, 2023 · 3 comments
Closed

Handlebars Template stripped out of classes #147

SirPhoros opened this issue Nov 27, 2023 · 3 comments

Comments

@SirPhoros
Copy link

I am trying to use a custom handlebars template, but when it renders the timeline, the elements within the template are completely stripped out of their classes.

I have seen this behaviour before #846 (visjs/vis-timeline#846), but it seemed to have been fixed in visjs/vis-timeline#1010 However, it looks like the problem has returned?

Any clue on how to work around it?

@daattali
Copy link
Owner

daattali commented Dec 2, 2023

Thanks for the report. It looks like your issue is with the xss protection that was added (it caused a lot of people issues). The fix you refer to is a way to disable the xss protection, but it's still enabled by default, and must be explicitly disabled.

However, the way it was implemented, the xss protection can only be disabled at initialization, and it cannot be disabled afterwards (see this comment). This is a problem because in {timevis} every timeline is initialized as empty initially, and then all the options get added to it afterwards. So disabling xss protection doesn't work.

I need to find a way to allow the widget to set a parameter on itself initially, which currently isn't supported. I've filed an issue with {htmlwidgets} to get help for this. ramnathv/htmlwidgets#482

@SirPhoros
Copy link
Author

Sweet!

Yeah, I realised I tried to change the xss protection once I created the timeline, and I didn't realise that I couldn't change it once it's created. It makes sense as it prevents further security issues.

Thank you so much!

@daattali
Copy link
Owner

daattali commented Dec 4, 2023

If the issue in {htmlwidgets} gets resolved, I might be able to get this to work. I'll update you if that happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants