pwwang/liquidpy

Tags after accented characters are not supported

Closed this issue · 2 comments

I tested it within an include:

file_A:

{% assign foo = "test" %}
{% include "file_B" %}

file_B:

{{foo}}
Accented character "ì" for testing
{{foo}}

Program:

from liquid import Liquid
with open ("file_A", "r") as myfile:
    data=myfile.read()
liq = Liquid(data)
ret = liq.render()

Error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/liquid/__init__.py", line 168, in render
    raise LiquidRenderError('\n'.join(msg)) from None
liquid.exceptions.LiquidRenderError: SyntaxError: invalid syntax

Template call stacks:
----------------------------------------------
File <LIQUID TEMPLATE SOURCE>
  > 2. {% include "file_B" %}
File file_B
    1. {{foo}}
    2. Accented character "ì" for testing
  > 3. {{foo}}

Compiled source (turn debug off to hide this):
----------------------------------------------
  17.   _liquid_ret_append(foo)
  18.   _liquid_ret_extend([
  19.     '\n',
  20.     'Accented character "ì" for testing\n',
  21.   ])
> 22.   _liquid_ret_append({foo)
  23.   _liquid_ret_append('\n')
  24.   _liquid_ret_extend([
  25.     '\n',
  26.     '\n',
  27.   ])

Context:
----------------------------------------------
  true: True
  false: False
  nil: None
  _liquid_liquid_filters: {'abs': <function _abs at 0x7f ... url_decode at 0x7fd4bcdc1598>}

The first tag is accepted. The second one generates an exception.

Thanks for reporting this. It's now fixed in v0.2.2

I confirm that it is fixed, thanks