dznqbit

pre Tags Inside Haml Without Going Insane

Stuffing some genius code inside <pre> tags?

And you just need to use haml because you can't even < and > ? Use a squiggly HEREDOC .

win.html.haml
%h1 <3 Ruby 2.3

:ruby
  my_ruby_code = <<~'EOS'
    next_level = [1, 2, 3].map do |i|
      i + 1
    end

    puts next_level.join(" ")
  EOS

%pre= my_ruby_code