-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Parse error on some handlebars code snippets in markdown #9
Comments
Ah yes... I think part of the issue might be it didn't work exactly fine in 0.12.x, but failed silently. If I have this in my src/index.md file and compile w/ [email protected]… then I get the following generated output: <pre><code class="language-hbs"><h1></h1>
</code></pre> So liquidjs (the default parser for *.md files) doesn't know how to interpret But now in Eleventy v1 (which uses liquidjs@9 vs liquidjs@6 in Eleventy v0.12.x), it will throw a parsing error on the invalid
One workaround might be to wrap your
This should give you the following output in Eleventy 1.0: <pre><code class="language-hbs"><h1>{{or @foo "default"}}</h1>
</code></pre> |
oh interesting. I see in the docs as well that liquidjs is the default parser. Since all my files are markdown, would changing the template engine be the right way forward for me? Or to debug why liquidJS doesn't like this syntax? It seems to be ok with fenced code blocks in general, so maybe it's a bug that it fails on this specifically? (even in 0.12 when it was a silent failure) |
I think the problem is that liquidjs is trying to parse handlebars snippets. If you don't want liquid to parse blocks of code, you'd have to either
But yeah fenced code blocks are fine, but liquidjs is trying to parse the templates for custom tags or shortcodes or variables and then throwing errors when it encounters unexpected Handlebars syntax. |
Describe the bug
Exception in markdown template parsing:
I've included a backslash in the snippet below for Github's markdown parsing, it is not in my actual markdown file
To Reproduce
With
"@11ty/eleventy": "1.0.0"
Create
.md
file with syntax abovenpm run start
ornpm run build
See error
Environment:
Additional context
Build worked fine with
v0.12.1
!The text was updated successfully, but these errors were encountered: