Skip to content

Conversation

@mathieu-mbru
Copy link

Replace source = doc.to_s by source = doc.to_s.gsub('&lt;', '<').gsub('&gt;', '>').gsub('&amp;', '&')
for transforming the encodings

…('&gt;', '>').gsub('&amp;', '&') for transforming the encodings
@nanego
Copy link

nanego commented Mar 17, 2022

A more generic solution may be this one. Can you please give it a try?

-        source = doc.to_s
+        source = CGI.unescapeHTML doc.to_s

@mathieu-mbru
Copy link
Author

Well, thank you for this solution.

@HighwayStar
Copy link

Any updates on this pull? Faced this issue, spent hours to find root of issue with js code after applying deface patches on redmine.

@froger
Copy link

froger commented Apr 17, 2025

Hi, I can reproduce the bug in a different situation that makes me suffer this last two years, and the PR fixes it!

given that files:

  • /app/views/proposals/index.html.erb
  • /app/views/proposals/index.js.erb

Then if I do an override on proposals/index, the .js.erb ends up with html-encoded chars.

Deface is heavily used by Decidim ecosystem to do modules, so we do know this bug have been there for a while. I would really appreciate if we could merge the PR, this will enable to have much more straight forward use of the gem.

Edit: using deface 1.9.0

@damianlegawiec
Copy link
Member

Hey @froger

Happy to move this repo outside of Spree org to a dedicated one and hand over maintenance. We don't use Deface at Spree anymore, hence our reduced engagement here

@alexandermeindl
Copy link

Hey @damianlegawiec,
can you tell me, what is your replacement for Deface at Spree?

@froger
Copy link

froger commented Apr 17, 2025

Thanks @damianlegawiec, need some time to answer that one. It might be a good solution for us, but need to gather feedbacks first.

@froger
Copy link

froger commented Apr 28, 2025

Hi @damianlegawiec,
Thanks for waiting. So you can transfert the gem to the organization https://github.com/decidim-ice the Decidim International Community Environment.
My company Octree will invest some time yearly to maintain the gem, and we hope other contributors from the ecosystem will chime in to improve and dinamise the gem.

I will contact you in MP to know more about how we can make the switch effective in rubygem too.
Thanks a lot !

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

Successfully merging this pull request may close these issues.

6 participants