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

Sinatra::Capture is not compatible with Haml 6 #1816

Closed
jkowens opened this issue Sep 26, 2022 · 1 comment · Fixed by #1820
Closed

Sinatra::Capture is not compatible with Haml 6 #1816

jkowens opened this issue Sep 26, 2022 · 1 comment · Fixed by #1820

Comments

@jkowens
Copy link
Member

jkowens commented Sep 26, 2022

Haml::Buffer was removed.

See: haml/haml#1058, haml/haml#1057

Hi @k0kubun any suggestions on how to handle this code below?

if haml? && Tilt[:haml] == Tilt::HamlTemplate
buffer = Haml::Buffer.new(nil, Haml::Options.new.for_buffer)
with_haml_buffer(buffer) { capture_haml(*args, &block) }

@k0kubun
Copy link
Contributor

k0kubun commented Sep 26, 2022

As to capturing a block, when disable_capture is false (default except for Rails), you can capture a block content by just calling a block when the method is called from - script (not = script). You don't need to rely on Haml::Buffer for capturing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants