Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

unexpected token: % #2

Open
tsundberg opened this issue Jul 17, 2016 · 0 comments
Open

unexpected token: % #2

tsundberg opened this issue Jul 17, 2016 · 0 comments

Comments

@tsundberg
Copy link

tsundberg commented Jul 17, 2016

When I paste the example below into a GitBook


{% codetabs name="Python", type="py" -%}
msg = "Hello World"
print msg
{%- language name="JavaScript", type="js" -%}
var msg = "Hello World";
console.log(msg);
{%- language name="HTML", type="html" -%}
<b>Hello World</b>
{%- endcodetabs %}

And do

gitbook serve

I get this error:

Template render error: (/Users/tsu/projects/cucumber/cucumber/docs/10-minute-tutorial.md) [Line 16, Column 38]
  unexpected token: %}

And the server stops.

To resolve it, I need to use this example:

{% codetabs name="Python", type="py" %}
msg = "Hello World"
print msg
{% language name="JavaScript", type="js" %}
var msg = "Hello World";
console.log(msg);
{% language name="HTML", type="html" %}
<b>Hello World</b>
{% endcodetabs %}

The difference is the usage of -% and %-

I installed GitBook using [email protected] and is using node v6.3.0

Have I found a bug in the documentation or am I using codetabs incorrect?

tsundberg added a commit to cucumber/common that referenced this issue Jul 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant