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

Error with double curly brackets "}}" inside code blocks in cobalt 0.15.0 #320

Closed
uwearzt opened this issue Dec 28, 2018 · 5 comments
Closed
Labels
question Uncertainty is involved std-compatibility Jekyll flavor of liquid

Comments

@uwearzt
Copy link

uwearzt commented Dec 28, 2018

Starting with 0.15.0 i get an error message

Error: build command failed
Caused by: Failed to render content for "posts/2011/03/04/sending-apple-push-notifications-with-erlang.html"
Caused by: liquid:    --> 100:27
    |
100 | "{"aps":{"alert":"Message"}}"␊
    |                           ^---
    |
    = expected EOI, Tag, Expression, or Raw

from the code blob:

```erlang
2> pushnotification:send("Message").
"{"aps":{"alert":"Message"}}"

this works perfectly fine:

```erlang
2> pushnotification:send("Message").
"{"aps":{"alert":"Message"} }"

i guess the content inside a code block should be completely ignored by cobalt / liquid.

@epage
Copy link
Member

epage commented Dec 28, 2018

We got a new, more conformant liquid parser in cobalt 0.15. For example, see some of the parsing quirks that are supported. I'm not too sure what the right answer for this parsing quirk is.

@Goncalerta, I'm assuming we'd have to actually run the ruby version of liquid to know what their behavior is on this.

Some workarounds

{% raw %}
```erlang
2> pushnotification:send("Message").
"{"aps":{"alert":"Message"} }"
...
{% endraw %}

or

{% highlight erlang %}
2> pushnotification:send("Message").
"{"aps":{"alert":"Message"} }"
...
{% endhighlight %}

i guess the content inside a code block should be completely ignored by cobalt / liquid.

The problem is markdown and liquid processing are different phases and they have no knowledge of each other. You can use the liquid on markdown, html, json, etc.

@epage epage transferred this issue from cobalt-org/cobalt.rs Dec 28, 2018
@epage epage added question Uncertainty is involved std-compatibility Jekyll flavor of liquid labels Dec 28, 2018
@Geobert
Copy link
Contributor

Geobert commented Jan 17, 2019

I've encountered this, and neither {% raw %} nor {% highlight %} help :-/

adding a space between the braces does help

@Geobert
Copy link
Contributor

Geobert commented Jan 18, 2019

It seems that {% raw %} is not working at all. I have a piece of post with {% raw %} that used to work and it's broken now

@Geobert
Copy link
Contributor

Geobert commented Jan 23, 2019

Is there a release of cobalt with this fix soon? It breaks my blog :-/

@epage
Copy link
Member

epage commented Jan 23, 2019

Liquid has been published. I've got a PR out to update cobalt and will then release.
cobalt-org/cobalt.rs#590

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Uncertainty is involved std-compatibility Jekyll flavor of liquid
Projects
None yet
Development

No branches or pull requests

3 participants