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

registerAsyncHelper using the wrong replace call #144

Closed
jtwebman opened this issue Aug 22, 2018 · 0 comments · Fixed by #149
Closed

registerAsyncHelper using the wrong replace call #144

jtwebman opened this issue Aug 22, 2018 · 0 comments · Fixed by #149

Comments

@jtwebman
Copy link
Collaborator

In the express render it waits for these calls and then replaces the string value. The issue is JavaScript string replace uses a special string value. So if the what you are replacing has $', $$, etc... (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter) then it does the wrong thing. I am going to open a PR that switches this to a function which doesn't have this logic in it.

jtwebman pushed a commit to jtwebman/express-hbs that referenced this issue Aug 22, 2018
jtwebman pushed a commit to jtwebman/express-hbs that referenced this issue Aug 26, 2018
jtwebman added a commit to jtwebman/express-hbs that referenced this issue Aug 27, 2018
Fixed TryGhost#144 registerAsyncHelper using the wrong replace call
Fixes TryGhost#143 Update handlebars to 4.0.8 (did latest handlebars)
Fixed TryGhost#101 Cached blocks should be stored per request
Fixed TryGhost#100 Conflict between content blocks
Fixed TryGhost#99 Blocks prone to memory leaks

After digging round most of the weekend I fixed the block and sync cache issues by storing them
on the options which is setup once per request and passed to everything that needed it. This
also fixes the issue with using replace and special strings that can do funny things with
JavaScript replace vs using the function version.

I also update TravisCI to run the newer node versions for tests and update all the dependencies
to the latest versions.
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

Successfully merging a pull request may close this issue.

1 participant