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

JS with custom delimiter #102

Closed
KAVA-Leigh opened this issue Mar 13, 2020 · 2 comments
Closed

JS with custom delimiter #102

KAVA-Leigh opened this issue Mar 13, 2020 · 2 comments

Comments

@KAVA-Leigh
Copy link

KAVA-Leigh commented Mar 13, 2020

Hi there,

We are using custom delimiters ( ['{$', '}'] ) and this is where the issue lies - when trying to include JS snippets we have errors and this is only when using the closing curly as delimiter, which is obviously the same as JS closing brace.

Any suggestions for working around this, or do we need to choose a different closing delimiter?

i.e.

{$! 
   color = 'blue'; 
   resp = '';
   switch(color){
      case 'blue':
           resp = `the color is ${color}`;
           break;
      default:
           resp = 'no color chosen';
   }    // <-- this is being interpreted as closing delimiter, no EOF
}

This is a pointless operation, it is just a simplified example..

EDIT: We moved to a different delimiter set in order to resolve this issue '['{#,'#}']'.
It seems likely that there is no other resolution for the original issue, in which case it may be helpful to just include a warning in the documentation, perhaps ?

@jjhbw
Copy link
Collaborator

jjhbw commented Apr 13, 2020

Thanks for the report! I'll do some digging. Probably best if we just update the docs to discourage this case for now.

jjhbw added a commit that referenced this issue Apr 25, 2020
jjhbw added a commit that referenced this issue Apr 25, 2020
@jjhbw
Copy link
Collaborator

jjhbw commented Apr 25, 2020

Added a paragraph to the docs to try and prevent this. Thanks for bringing it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants