-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Support for raw handlebars output #436
Comments
Why is it |
With regular handlebars blocks, the content is parsed:
This will output:
|
Added a gist of my test script: https://gist.github.com/andeersg/5dc6a6f794470c30f348df4e79a5b321 |
I did some more testing and figured out it's a problem that only happens in markdown files. I created a small repo that shows the issue: https://github.com/andeersg/elventy_hb_issue |
I added a few tests based on your code and the sample in the handlebars documentation and this seems to be working fine (as you stated) in handlebars files. Just as a note for future me, I did run into this issue while added the tests: handlebars-lang/handlebars.js#1156 Specifically, I’m guessing this is the classic Markdown indented code blocks issue. I just added this to the common pitfalls yesterday. You can read about it here: https://www.11ty.io/docs/languages/markdown/#there-are-extra-%3Cpre%3E-and-%3Ccode%3E-in-my-output Related: #402 |
Tests at eleventy/test/TemplateRenderHandlebarsTest.js Line 178 in 0812197
eleventy/test/TemplateRenderHandlebarsTest.js Line 192 in 0812197
|
Thank you for your reply :) But is there a solution to this? Or is it tricky to solve? I tested another thing:
and it's also evaluated to:
so it seems like the indentation is not the problem. |
Hmm that’s strange—your result directly contradicts the results of the tests I’ve added, which seem to be almost identical to eleventy/test/TemplateRenderHandlebarsTest.js Line 192 in 0812197
OH haha I think I’ve just realized what was happening. What template engine are you using to process markdown files? Surely it’s not handlebars. Your See the info block on https://www.11ty.io/docs/languages/markdown/ |
|
Thank you again for your reply, changing the markdown engine to |
I have a problem with Handlebars and raw output.
I use handlebars as a template engine, and encountered a problem when I wanted to display some handlebars code in
<pre>
tags.If I don't do anything extra the handlebars code is parsed.
This:
Becomes:
Then I tried to create a raw helper:
But it just ends up like this:
A small test with the handlebars library directly works:
This will render it like:
Is raw tags not supported? Or am I doing something wrong? I have tried both with
addHandlebarsHelper
and:The text was updated successfully, but these errors were encountered: