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

Strange Substitution Issue #60

Closed
schetnikovich opened this issue Apr 8, 2015 · 2 comments
Closed

Strange Substitution Issue #60

schetnikovich opened this issue Apr 8, 2015 · 2 comments

Comments

@schetnikovich
Copy link

In the latest Marko versions and in some cases and words in templates are replaced with && symbols.

For this template:

We're young.
<div>
    You and me are friends and teammates.
</div>

The following *.marko.js file will be generated:

out.w('We\'re\' \'young. <div>You && me are friends && teammates.</div><div style="color:blue">You '

Necessary Conditions

  1. You should use marko-layout module.
  2. You should have unpaired ' symbol in your template.

There are probably other conditions, when this issue happens, but I know only one set of conditions.

Minimal project

Here I prepared a minimal project that will help to reproduce this issue:
https://github.com/schetnikovich/marko-substitution-poltergeist

Reasons

I don't know actual reason of this problem, but for the end user this is because of ' symbol, that
makes all subsequent and words be replaced by && symbol.

If you'll "close" single quotes, i.e. We'are' young - everything will be correct.

Workaround

Replace all single quotes with the following:

$("'")
@patrick-steele-idem
Copy link
Contributor

New version of marko published with fix: marko@2.2.2

Thanks for setting up the project to reproduce the problem and thank you for bringing this problem to our attention!

@schetnikovich
Copy link
Author

Thank you very much for so quick fix! Issue disappeared.

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

No branches or pull requests

2 participants