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

Passing url in JSON crashing rendering #11

Closed
michalg- opened this issue Nov 17, 2021 · 0 comments
Closed

Passing url in JSON crashing rendering #11

michalg- opened this issue Nov 17, 2021 · 0 comments

Comments

@michalg-
Copy link

michalg- commented Nov 17, 2021

Hello, I have a problem with rendering img tag.
I have a quite simple view

.rounded.overflow-hidden.border-2.border-grey-200.border-opacity-100
  %img.w-full{src: "#{self['image_url']}", alt: "Sunset in the mountains"}
  .px-6.py-4

and when i’m passing an object:

$document.at('#main-container').inner_html = Template['views/quiz/form'].render(res.json)

res:

{"id": "95b4406d-2bca-4d86-94f4-12078d11eca4", "image_url": "http://localhost:3000/derivations/crop/1600/1000/eyJpZCI6InF1aXovOTViNDQwNmQtMmJjYS00ZDg2LTk0ZjQtMTIwNzhkMTFlY2E0L2ltYWdlLzFkY2RlYTZhNDMwNGI0NzkwYThmZjI5MWQwYzY5NmQxLmpwZWciLCJzdG9yYWdlIjoic3RvcmUifQ?signature=1dd23cba5070cf334507f9eafc55b4e97c4539be9c502d05040f4678c9192e47" }

It throws

undefined method `html_escape_without_haml_xss' for Haml::Helpers

in the browser console. When I’m setting any string as url, not value from self it works. There is any way to bypass that?

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

1 participant