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

Haml6 doesn't render properly with yield #1094

Closed
mishina2228 opened this issue Sep 28, 2022 · 2 comments
Closed

Haml6 doesn't render properly with yield #1094

mishina2228 opened this issue Sep 28, 2022 · 2 comments

Comments

@mishina2228
Copy link
Contributor

First of all, thanks for Haml6!

After upgrading Haml from 5.x to 6.x, Haml doesn't render properly yielded content.

Repro:

  • layout.haml
    !!! XML
    !!!
    %html
      %body
        .container
          = yield
  • partial.haml
    .content
      partial
  • render.rb
    require 'haml'
    require 'tilt'
    
    layout = Tilt.new('layout.haml')
    partial = Tilt.new('partial.haml')
    
    p layout.render { partial.render }

With Haml5:

"<!DOCTYPE html>\n<html>\n<body>\n<div class='container'>\n<div class='content'>\npartial\n</div>\n\n</div>\n</body>\n</html>\n"

With Haml6:

"<!DOCTYPE html>\n<html>\n<body>\n<div class='container'>\n&lt;div class=&#39;content&#39;&gt;\npartial\n&lt;/div&gt;\n\n</div>\n</body>\n</html>\n"

Is this a problem with Haml? Or is my code wrong?

@dentarg
Copy link

dentarg commented Sep 28, 2022

I think you want to do != yield

@mishina2228
Copy link
Contributor Author

It works! Thanks for your help!

mishina2228 added a commit to mishina2228/nova_git_stats that referenced this issue Sep 29, 2022
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

2 participants