File tree Expand file tree Collapse file tree
padrino-helpers/lib/padrino Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11= CHANGES
22
3+ == 0.16.1 (2025-12-12)
4+
5+ - FIX #2312 Change HAML setup to support newer versions (@crashtech)
6+ - FIX #2311 Loosen bundler version pinning (achiurizo)
7+
38== 0.16.0 (2025-12-02)
49
510- NEW Code modernization. Codebase is now passing Rubocop and generator's templates are using modern syntax (@crashtech)
Original file line number Diff line number Diff line change @@ -405,8 +405,6 @@ def content_type_symbol(type)
405405unless defined? Padrino ::Rendering ::HamlTemplate
406406 begin
407407 require 'haml'
408- require 'haml/helpers/xss_mods'
409- require 'haml/helpers/action_view_extensions'
410408 rescue LoadError
411409 # do nothing since haml is not available
412410 else
Original file line number Diff line number Diff line change 1- module Haml
2- module Helpers
3- include XssMods
4- include ActionViewExtensions
5- end
1+ begin
2+ using_modern_haml = false
3+ require 'haml/helpers/xss_mods'
4+ require 'haml/helpers/action_view_extensions'
5+
6+ module Haml
7+ Helpers . include ( Helpers ::XssMods )
8+ Helpers . include ( Helpers ::ActionViewExtensions )
69
7- module Util
8- def self . rails_xss_safe?
10+ def Util . rails_xss_safe?
911 true
1012 end
1113 end
14+ rescue LoadError
15+ using_modern_haml = true
1216end
1317
1418module Padrino
@@ -21,6 +25,13 @@ class HamlTemplate < Tilt::HamlTemplate
2125
2226Tilt . prefer ( Padrino ::Rendering ::HamlTemplate , :haml )
2327
24- Padrino ::Rendering . engine_configurations [ :haml ] = {
25- escape_html : true
26- }
28+ Padrino ::Rendering . engine_configurations [ :haml ] =
29+ if using_modern_haml
30+ {
31+ buffer_class : 'SafeBuffer.new' ,
32+ use_html_safe : true ,
33+ disable_capture : true
34+ }
35+ else
36+ { escape_html : true }
37+ end
You can’t perform that action at this time.
0 commit comments