# Syntax change - character not allowed

**URL:** <https://talk.jekyllrb.com/t/syntax-change-character-not-allowed/4164>\
**Category:** Uncategorized\
**Created:** [March 30, 2020, 4:19pm UTC](https://talk.jekyllrb.com/t/syntax-change-character-not-allowed/4164 "2020-03-30T16:19:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabads](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/kabads/32/204_2.png) [@kabads](https://talk.jekyllrb.com/u/kabads)\
**Post date:** [March 30, 2020, 4:19pm UTC](https://talk.jekyllrb.com/t/syntax-change-character-not-allowed/4164/1 "2020-03-30T16:19:40Z")

</div>

I’ve been getting a warning show up (not sure when this started, as I’ve had a long break from this blog.

This is the warning:

```
  Liquid Warning: Liquid syntax error (line 26): Unexpected character { in "post.categories contains {{category}}" in /_layouts/categories.html

```

and this is the code

```
  --
title: Categories
layout: categories
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">

{%- include head.html -%}

<body>

{%- include header.html -%}

<main class="page-content" aria-label="Content">
    <div class="wrapper">
        <div class="home">
    {%- if page.title -%}
    <h4 class="page-heading">{{ page.title }}</h4>
    {%- endif -%}

    <p>
        {%- for category in site.categories -%}
        <a href="{{category.title | downcase}}.html">{{ category.title }}</a> |&nbsp
        {%- endfor -%}
    </p>
            <!-- This variable is needed for the comparison -->
            {% assign category = page.title|downcase %}
            <!-- Now we can loop through -->
        {% for post in site.posts %}
        {% if post.categories contains {{category}} %}
            <li><a href="{{post.url}}">{{ post.title }}</a></li>
        {% endif %}
        {% endfor %}

    {%- if site.posts.size > 0 -%}
    <h4 class="post-list-heading">{{ page.list_title }}</h4>
    <ul class="post-list">
        {%- for post in paginator.posts -%}
        <li>
            {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
            <span class="post-meta">{{ post.date | date: date_format }}</span>
            <h5>
                <a class="post-link" href="{{ post.url | relative_url }}">
                    {{ post.title | escape }}
                    {{ post.category }}

                </a>
            </h5>
            {%- if site.show_excerpts -%}
            {{ post.excerpt }}
            {%- endif -%}
        </li>
        {%- endfor -%}
    </ul>

    <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</></p>
    {%- endif -%}

</div>

    </div>
</main>

{%- include footer.html -%}

</body>

</html>
```

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [March 30, 2020, 7:57pm UTC](https://talk.jekyllrb.com/t/syntax-change-character-not-allowed/4164/2 "2020-03-30T19:57:15Z")

</div>

> [@kabads](#):
>
> {% if post.categories contains {{category}} %}

I think this line here is your problem.

---

<div class="post-metadata">

**Author:** ![kabads](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/kabads/32/204_2.png) [@kabads](https://talk.jekyllrb.com/u/kabads)\
**Post date:** [March 30, 2020, 9:33pm UTC](https://talk.jekyllrb.com/t/syntax-change-character-not-allowed/4164/3 "2020-03-30T21:33:43Z")

</div>

Thanks - I thought that too from the error. I’ve removed the curly braces and it the problem has been solved.
