fix: mark strings in haml javascript as html_safe

They were escaped before and triggered exceptions in the browser.
This commit is contained in:
Azul 2023-04-06 20:35:18 +02:00
parent 3150553338
commit fcc9d44b2c
3 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@
// Autocomplete caches results in sessionStorage.
// After logging out, the session storage should be cleared.
#{ "if(sessionStorage.length > 0) sessionStorage.clear();" unless logged_in? }
#{ "if(sessionStorage.length > 0) sessionStorage.clear();".html_safe unless logged_in? }
- if content_for?(:dom_loaded)
:javascript

View File

@ -1,5 +1,5 @@
- content_for :dom_loaded do
= "$('new_post').scrollToBottom();"
$('new_post').scrollToBottom();
- content_for :title do
.h1= link_to_user(@recipient, avatar: 'medium')

View File

@ -144,7 +144,7 @@ module ModalboxHelper
format('Modalbox.setStrings(%s)', {
ok: I18n.t(:ok_button), cancel: I18n.t(:cancel), close: I18n.t(:close_button),
alert: I18n.t(:alert), confirm: I18n.t(:confirm), loading: I18n.t(:loading_progress)
}.to_json)
}.to_json).html_safe
end
private