Skip to content

include .html with variables go wrong #61

@1aron

Description

@1aron

index.html

<div class="x-4 h-full">
    {% include '../shared/_picker.html' with {start: 0, end: 9} %}
</div>

shared/_picker.html

{% for index in start..end %}
    <a class="picker-item f-orange">{{ index }}</a>
{% endfor %}

Above, It compile correctly but output the following errors. My test results tell me that because the parameter of the{% for %} tag is the incoming dynamic variable (with), this error is caused.

TypeError: low.charCodeAt is not a function
    at Object.range (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:4334:30)
    at Object.Twig.expression.operator.parse (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3506:44)
    at Twig.Template.parse (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:2134:46)
    at expressionToken (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3117:51)
    at next (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:7996:24)
    at Object.forEachAsync [as forEach] (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:8007:16)
    at Twig.Template.<anonymous> (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3099:31)
    at Object.potentiallyAsync (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:7743:48)
    at Twig.Template.Twig.expression.parse (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:3098:27)
    at Twig.Template.Twig.expression.parseAsync (/usr/local/lib/node_modules/@master/cli/node_modules/twig/twig.js:7690:38)

However, if I change the _picker.html extension to _picker.twig It will work, but I don't want my team to use it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions