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

unexpected token: % #2

@tsundberg

Description

@tsundberg

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 npm@3.10.3 and is using node v6.3.0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions