Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Delimiters' settings don't work correctly #122

Open
sakekasi opened this issue Dec 2, 2021 · 0 comments
Open

'Delimiters' settings don't work correctly #122

sakekasi opened this issue Dec 2, 2021 · 0 comments
Labels
Projects

Comments

@sakekasi
Copy link

sakekasi commented Dec 2, 2021

Hi,

I'm using posthtml-expressions as a part of maizzle to generate templates. I used the following settings to change my delimiters:

expressions: {
  delimiters: ['[[', ']]'],
  unescapeDelimiters: ['[[[', ']]]'],
}

Which almost worked, but I kept getting this error:

SyntaxError: SyntaxError: Unexpected identifier
    at placeholders (/Users/sakekasi/Vesica/shift-search/node_modules/posthtml-expressions/lib/placeholders.js:62:19)
    at /Users/sakekasi/Vesica/shift-search/node_modules/posthtml-expressions/lib/index.js:190:14
    at Array.reduce (<anonymous>)
    at walk (/Users/sakekasi/Vesica/shift-search/node_modules/posthtml-expressions/lib/index.js:177:27)

when trying to process this code:

{{ #each items }}
  <li class="mt-0 mb-10 ml-32 mr-0">
    <a href="{{ url }}">{{ symbol }}</a>
  </li>
{{ /each }}

I used the workaround detailed here to get a stopgap fix in for the issue, but I wanted to bring the problem up here, so it could get resolved.

Thanks

PS. I also tried doing this:

<raw>
{{ #each items }}
  <li class="mt-0 mb-10 ml-32 mr-0">
    <a href="{{ url }}">{{ symbol }}</a>
  </li>
{{ /each }}
</raw>

and this

<raw>{{ #each items }}</raw>
  <li class="mt-0 mb-10 ml-32 mr-0">
    <a href="{{ url }}">{{ symbol }}</a>
  </li>
<raw>{{ /each }}</raw>

to no avail.

@Scrum Scrum added the bug label Dec 8, 2021
@Scrum Scrum added this to Fix in v1.9.1 Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants