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
HAML partial rendering fails because of missing _erbout
binding
#1639
Comments
This is likely the result of Haml 6.0 changing the API (see #1595). I haven’t been able to figure out how to make the filtering helper work with Haml 6, and the same underlying reason is making it impossible to use |
So I've been exploring From a5fb9efd821419f8b8e4f1248587182292af00e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Maniaci?= <stephane.maniaci@gmail.com>
Date: Wed, 28 Dec 2022 00:15:17 +0100
Subject: [PATCH] filters: get the Haml filter to play nicely
We rely on an output buffer of `_erbout`, and we want to handle
`capture` statements ourselves, which was already being done for the
Slim filter but not the Haml one.
---
nanoc/lib/nanoc/filters/haml.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/nanoc/lib/nanoc/filters/haml.rb b/nanoc/lib/nanoc/filters/haml.rb
index 8d57d8df6..052b58efe 100644
--- a/nanoc/lib/nanoc/filters/haml.rb
+++ b/nanoc/lib/nanoc/filters/haml.rb
@@ -15,7 +15,11 @@ module Nanoc::Filters
# @return [String] The filtered content
def run(content, params = {})
# Get options
- options = params.merge(filename: filename)
+ options = params.merge(
+ filename: filename,
+ outvar: '_erbout',
+ disable_capture: true
+ )
# Create context
context = ::Nanoc::Core::Context.new(assigns)
--
2.38.1
Hopefully this provides a starting point for an actual fix, or better yet, might be the fix? Do let me know if I can be of any help when you get a chance to look at it. |
Ooh, thanks for looking into this! I’m short on time, but will try to give this a closer look. PRs are also always appreciated too! |
Steps to reproduce
Expected behavior
The template compiles normally.
Actual behavior
Details
I'm probably doing something wrong but I just cannot figure out what it is. I've made a repo with the full files but it looks roughly like this:
Crash log
https://gist.github.com/freesteph/13a20fe7a618f1229e2d6b7c6073a8d6
Thank you.
The text was updated successfully, but these errors were encountered: